Comments (6)
I cannot reproduce this behavior. If package.json
is updated, Vitest will close the running process and start a new one - maybe something happens during this?
None from vitest itself.
The output
channel will contain at least the version, so if you don't see anything there, then you don't have the extension installed. Did you actually check it?
from vscode.
Hello @SimmeNilsson. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction
will be closed if they have no activity within 3 days.
from vscode.
I've updated my initial description with output and reproduction repo.
Steps described in the README of the repo.
I think this approach should be pretty reliable.
Basically one needs to trigger an upgrade/downgrade of either rollup or esbuild (after making sure the plugin has been exercised) to see the issue.
As for the output, it is not when I exercise the test that I have the problem.
When running it is just normal output.
It is when I perform my package upgrade and yarn tries to unlink rollup and/or esbuild that I get the problem.
That was why I wrote like I initially did.
Edit: The file locking process in my last repro was
"C:\Program Files\nodejs\node.EXE" --dns-result-order=ipv4first C:/Users/.../.vscode/extensions/vitest.explorer-0.12.3/dist/worker.js
from vscode.
Output
Is this the full output at the moment of getting an error? Did you remove anything from it?
from vscode.
It is the full output.
As the tests run fine, should we expect anything more?
The problem I have is the file locks it seems to be keeping around rollup and esbuild when it isn't actively running tests.
The only error output I have is the one I get from yarn regarding the EPERM.
And when I track down the process responsible for holding the file (through Process Explorer), that process belongs to the plugin as far as I can tell (CLI line in last post).
from vscode.
[INFO 4:34:20 PM] [v0.12.3] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 4:34:22 PM] [API] Running Vitest v1.6.0 (FileLockVitestPlugin/vitest.config.mts) with Node.js: C:\Program Files\nodejs\node.EXE
[INFO 4:34:23 PM] [API] Vitest v1.6.0 (FileLockVitestPlugin/vitest.config.mts) process 66220 created
[INFO 4:34:25 PM] [API] Collecting tests: test/App.spec.ts
[INFO 4:36:01 PM] Running 1 file(s) with name pattern: ^\s?App math adds up$
[Worker] Collecting tests due to file changes: package.jso
[INFO 4:36:28 PM] [API] Vitest process 66220 closed successfully
[INFO 4:36:28 PM] [API] Running Vitest v1.6.0 (FileLockVitestPlugin/vitest.config.mts) with Node.js: C:\Program Files\nodejs\node.EXE
[INFO 4:36:29 PM] [API] Vitest v1.6.0 (FileLockVitestPlugin/vitest.config.mts) process 76060 created
I think I understand what you meant now.
That it restarts when package.json changes. However, within one second a new process is created.
If the unlinking of esbuild/rollup doesn't happen within that window, then a lock will be present (at least it seems to be for me).
In the two scenarios I've provided that window is either missed (A) or not present at all (B).
Scenario A
I manually add a resolution (can't be done through the yarn 1.x CLI AFAIK) to package.json.
Plugin process is automatically restarted.
Then I run yarn (install) to have package.json change reflected in node_modules and yarn.lock.
Scenario B
I delete the lock file and run yarn to recreate it, which might result in an upgrade of installed (within ranges given in package.json) esbuild or rollup.
package.json never touched.
Edit: Scenario C
Branch switch then yarn (install) to sync node_modules.
from vscode.
Related Issues (20)
- `root` field is not appended to `include` paths.
- Plugin needs an option to select a shell environment
- Coverage : Change color of line partially covered HOT 2
- Vitest v1.2.0 is not supported. Vitest v1.4.0 or newer is required. HOT 3
- `envalid` erroring out when continuous run is enabled and on first re-run
- Tests executing child_process not working inside extension
- Failed to get Node.js version HOT 6
- Always displaying vitest error on startup HOT 2
- Crash at startup on Windows when using Yarn PnP
- Can´t modify directory tree HOT 1
- Vitest fails to start if a compiled config is available
- No test output when debugging HOT 7
- Vitest failes to start in vscode >=1.90 when using Yarn PnP HOT 1
- Open VSX Registry (VSCodium) forcing outdated version (1.0.0-beta.X) HOT 7
- Vitest failed to start error on .d.ts files with v0.12.4
- Vitest process exited with exit code null HOT 2
- Color indicator of failing tests in Explorer and Tab Bar
- Debugger grinds to a halt with large unrelated files present HOT 1
- Debugging test regression after 0.10.7 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode.