vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Continuous run doesn't work with browser mode

Open sheremet-va opened this issue 2 months ago • 1 comments

Describe the bug

Click "Start continuous run" in samples/browser-v5 Edit the file See it runs tests Edit the file again The icon hangs and never stops

Expected behavior

Works normally

Reproduction

https://github.com/vitest-dev/vscode/tree/main/samples/browser-v5

Output

[INFO 12:36:27 PM] [v1.52.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 12:36:27 PM] [API] Resolving configs: browser-v5/vitest.config.ts
[12:36:27 PM] [API] Spawning on-demand process...
[INFO 12:36:27 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:28 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:28 PM] [API] On-demand process finished in 535ms
[INFO 12:36:28 PM] [API] Watching vitest.config.ts
[INFO 12:36:28 PM] [VSCODE] Watching browser-v5 with pattern **/*
[INFO 12:36:28 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:36:28 PM] [API] Spawning on-demand process...
[12:36:28 PM] [API] Filtering projects: chromium
[INFO 12:36:28 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:29 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:29 PM] [API] On-demand process finished in 632ms
[INFO 12:36:29 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:36:29 PM] [API] Spawning on-demand process...
[12:36:29 PM] [API] Filtering projects: chromium
[INFO 12:36:29 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:29 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:29 PM] [API] On-demand process finished in 395ms
[12:36:30 PM] [API] Filtering projects: chromium
[INFO 12:36:30 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:30 PM] Enqueuing "records a trace"
[12:36:30 PM] Enqueuing "records a second trace"
[INFO 12:36:30 PM] Running 1 file(s): [ 'basic.test.ts [chromium] (.+)' ]
[INFO 12:36:31 PM] [DECOR] Reset all decorations.
[12:36:31 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:36:31 PM] Enqueuing "records a trace"
[12:36:31 PM] Enqueuing "records a second trace"
[12:36:31 PM] No errors found for "basic.test.ts [chromium]"
[12:36:31 PM] Marking "records a trace" as passed
[12:36:31 PM] Marking "records a second trace" as passed
[12:36:31 PM] No errors found for "basic.test.ts [chromium]"
[12:36:31 PM] Ending test run basic.test.ts
[12:36:31 PM] [WORKER]  HTML  Report is generated

[12:36:31 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:36:31 PM] Disposing test runner
[12:36:31 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:31 PM] [VSCODE] Flushing 8 changed items
[12:36:38 PM] [VSCODE] Flushing 1 changed items
[INFO 12:36:38 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:36:38 PM] [API] Spawning on-demand process...
[12:36:38 PM] [API] Filtering projects: chromium
[INFO 12:36:38 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:38 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:38 PM] [API] On-demand process finished in 404ms
[12:36:40 PM] [VSCODE] Flushing 1 changed items
[INFO 12:36:41 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:36:41 PM] [API] Spawning on-demand process...
[12:36:41 PM] [API] Filtering projects: chromium
[INFO 12:36:41 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:41 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:41 PM] [API] On-demand process finished in 388ms
[12:36:44 PM] [API] Filtering projects: chromium
[INFO 12:36:44 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:45 PM] Enqueuing "records a second trace"
[INFO 12:36:45 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:36:45 PM] [DECOR] Reset all decorations.
[12:36:45 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:36:45 PM] Ignore "records a trace" during collection
[12:36:45 PM] Enqueuing "records a second trace"
[12:36:45 PM] No errors found for "basic.test.ts [chromium]"
[12:36:45 PM] Marking "records a trace" as skipped
[12:36:45 PM] Marking "records a second trace" as running (state is run)
[12:36:53 PM] Ending test run basic.test.ts
[12:36:53 PM] [WORKER]  HTML  Report is generated

[12:36:53 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 FAIL  Tests failed. Watching for file changes...

[12:36:53 PM] [WORKER]        press h to show help, press q to quit

[12:36:53 PM] Disposing test runner
[12:36:53 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:54 PM] [VSCODE] Flushing 8 changed items
[12:36:54 PM] [VSCODE] Flushing 1 deleted items
[INFO 12:36:54 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:36:54 PM] [API] Spawning on-demand process...
[12:36:54 PM] [API] Filtering projects: chromium
[INFO 12:36:54 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:36:54 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:36:54 PM] [API] On-demand process finished in 402ms
[12:37:00 PM] [VSCODE] Flushing 1 changed items
[INFO 12:37:00 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:37:00 PM] [API] Spawning on-demand process...
[12:37:00 PM] [API] Filtering projects: chromium
[INFO 12:37:00 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:01 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:01 PM] [API] On-demand process finished in 398ms
[12:37:01 PM] [VSCODE] Flushing 1 changed items
[INFO 12:37:01 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:37:01 PM] [API] Spawning on-demand process...
[12:37:01 PM] [API] Filtering projects: chromium
[INFO 12:37:01 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:02 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:02 PM] [API] On-demand process finished in 413ms
[12:37:03 PM] [VSCODE] Flushing 1 changed items
[INFO 12:37:04 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:37:04 PM] [API] Spawning on-demand process...
[12:37:04 PM] [API] Filtering projects: chromium
[INFO 12:37:04 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:04 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:04 PM] [API] On-demand process finished in 432ms
[12:37:10 PM] [API] Filtering projects: chromium
[INFO 12:37:10 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:11 PM] Enqueuing "records a second trace"
[INFO 12:37:11 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:37:11 PM] [DECOR] Reset all decorations.
[12:37:11 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:37:11 PM] Ignore "records a trace" during collection
[12:37:11 PM] Enqueuing "records a second trace"
[12:37:11 PM] No errors found for "basic.test.ts [chromium]"
[12:37:11 PM] Marking "records a trace" as skipped
[12:37:11 PM] Marking "records a second trace" as passed
[12:37:11 PM] No errors found for "basic.test.ts [chromium]"
[12:37:11 PM] Ending test run basic.test.ts
[12:37:11 PM] [WORKER]  HTML  Report is generated

[12:37:11 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:37:11 PM] [WORKER]  PASS  Waiting for file changes...

[12:37:11 PM] [WORKER]        press h to show help, press q to quit

[12:37:11 PM] Disposing test runner
[12:37:11 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:11 PM] [VSCODE] Flushing 8 changed items
[12:37:11 PM] [VSCODE] Flushing 1 deleted items
[12:37:12 PM] [API] Filtering projects: chromium
[INFO 12:37:12 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:13 PM] Enqueuing "records a second trace"
[INFO 12:37:13 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:37:13 PM] [DECOR] Reset all decorations.
[12:37:13 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:37:13 PM] Ignore "records a trace" during collection
[12:37:13 PM] Enqueuing "records a second trace"
[12:37:13 PM] No errors found for "basic.test.ts [chromium]"
[12:37:13 PM] Marking "records a trace" as skipped
[12:37:13 PM] Marking "records a second trace" as passed
[12:37:13 PM] No errors found for "basic.test.ts [chromium]"
[12:37:13 PM] Ending test run basic.test.ts
[12:37:13 PM] [WORKER]  HTML  Report is generated

[12:37:13 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 PASS  Waiting for file changes...

[12:37:13 PM] [WORKER]        press h to show help, press q to quit

[12:37:13 PM] Disposing test runner
[12:37:13 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:13 PM] [VSCODE] Flushing 8 changed items
[12:37:13 PM] [VSCODE] Flushing 1 deleted items
[12:37:25 PM] [VSCODE] Flushing 1 changed items
[INFO 12:37:26 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:37:26 PM] [API] Spawning on-demand process...
[12:37:26 PM] [API] Filtering projects: chromium
[INFO 12:37:26 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:26 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:26 PM] [API] On-demand process finished in 401ms
[12:37:26 PM] [API] Filtering projects: chromium
[INFO 12:37:26 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:27 PM] Enqueuing "records a second trace"
[INFO 12:37:27 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:37:27 PM] [DECOR] Reset all decorations.
[12:37:27 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:37:27 PM] Ignore "records a trace" during collection
[12:37:27 PM] Enqueuing "records a second trace"
[12:37:27 PM] No errors found for "basic.test.ts [chromium]"
[12:37:27 PM] Marking "records a trace" as skipped
[12:37:27 PM] Marking "records a second trace" as passed
[12:37:27 PM] No errors found for "basic.test.ts [chromium]"
[12:37:27 PM] Ending test run basic.test.ts
[12:37:27 PM] [WORKER]  HTML  Report is generated

[12:37:27 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:37:27 PM] [WORKER]  PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:37:27 PM] Disposing test runner
[12:37:27 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:27 PM] [VSCODE] Flushing 8 changed items
[12:37:27 PM] [VSCODE] Flushing 1 deleted items
[INFO 12:37:37 PM] [DECOR] Decorations for /Users/vladimir/Projects/vscode/samples/browser-v5/basic.test.ts are already cached. Displaying them.
[INFO 12:37:46 PM] [DECOR] Decorations for /Users/vladimir/Projects/vscode/samples/browser-v5/basic.test.ts are already cached. Displaying them.
[12:37:50 PM] [API] Filtering projects: chromium
[INFO 12:37:50 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:37:50 PM] Enqueuing "records a trace"
[INFO 12:37:50 PM] Running 1 file(s) with name pattern: ^records a trace$
[INFO 12:37:51 PM] [DECOR] Reset all decorations.
[12:37:51 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:37:51 PM] Enqueuing "records a trace"
[12:37:51 PM] Ignore "records a second trace" during collection
[12:37:51 PM] No errors found for "basic.test.ts [chromium]"
[12:37:51 PM] Marking "records a trace" as passed
[12:37:51 PM] Marking "records a second trace" as skipped
[12:37:51 PM] No errors found for "basic.test.ts [chromium]"
[12:37:51 PM] Ending test run basic.test.ts
[12:37:51 PM] [WORKER]  HTML  Report is generated
       You can run npx vite preview --outDir .vitest to see the test results.

[12:37:51 PM] [WORKER]  PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:37:51 PM] Disposing test runner
[12:37:51 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:37:51 PM] [VSCODE] Flushing 8 changed items
[12:37:51 PM] [VSCODE] Flushing 1 deleted items
[12:38:05 PM] [API] Filtering projects: chromium
[INFO 12:38:05 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:38:05 PM] Enqueuing "records a second trace"
[INFO 12:38:05 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:38:05 PM] [DECOR] Reset all decorations.
[12:38:05 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:38:05 PM] Ignore "records a trace" during collection
[12:38:05 PM] Enqueuing "records a second trace"
[12:38:05 PM] No errors found for "basic.test.ts [chromium]"
[12:38:05 PM] Marking "records a trace" as skipped
[12:38:05 PM] Marking "records a second trace" as passed
[12:38:05 PM] No errors found for "basic.test.ts [chromium]"
[12:38:05 PM] Ending test run basic.test.ts
[12:38:05 PM] [WORKER]  HTML  Report is generated

[12:38:05 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:38:05 PM] [WORKER]  PASS  Waiting for file changes...

[12:38:05 PM] [WORKER]        press h to show help, press q to quit

[12:38:05 PM] Disposing test runner
[12:38:05 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:38:06 PM] [VSCODE] Flushing 8 changed items
[12:38:06 PM] [VSCODE] Flushing 1 deleted items
[12:38:10 PM] [VSCODE] Flushing 1 changed items
[INFO 12:38:10 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:38:10 PM] [API] Spawning on-demand process...
[12:38:10 PM] [API] Filtering projects: chromium
[INFO 12:38:10 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:38:10 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:38:10 PM] [API] On-demand process finished in 432ms
[12:38:11 PM] [API] Filtering projects: chromium
[INFO 12:38:11 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:38:12 PM] Enqueuing "records a second trace"
[INFO 12:38:12 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:38:12 PM] [DECOR] Reset all decorations.
[12:38:12 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:38:12 PM] Ignore "records a trace" during collection
[12:38:12 PM] Enqueuing "records a second trace"
[12:38:12 PM] No errors found for "basic.test.ts [chromium]"
[12:38:12 PM] Marking "records a trace" as skipped
[12:38:12 PM] Marking "records a second trace" as passed
[12:38:12 PM] No errors found for "basic.test.ts [chromium]"
[12:38:12 PM] Ending test run basic.test.ts
[12:38:12 PM] [WORKER]  HTML  Report is generated

[12:38:12 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:38:12 PM] [WORKER]  PASS  Waiting for file changes...

[12:38:12 PM] [WORKER]        press h to show help, press q to quit

[12:38:12 PM] Disposing test runner
[12:38:12 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:38:12 PM] [VSCODE] Flushing 8 changed items
[12:38:12 PM] [VSCODE] Flushing 1 deleted items
[INFO 12:38:13 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:38:14 PM] [WORKER] 
 DEV  v5.0.0 /Users/vladimir/Projects/vscode/samples/browser-v5
      API started at http://localhost:63315/


[INFO 12:38:14 PM] [RUNNER] Watching test files: basic.test.ts with pattern ^records a second trace$
[12:38:15 PM] [WORKER] 
[12:38:15 PM] [WORKER]  RERUN  basic.test.ts x1 
        Test name pattern: /^records a second trace$/


[12:38:15 PM] Enqueuing "records a second trace"
[12:38:15 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:38:15 PM] [VSCODE] Flushing 1 changed items
[INFO 12:38:15 PM] [DECOR] Reset all decorations.
[12:38:15 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:38:15 PM] Ignore "records a trace" during collection
[12:38:15 PM] Enqueuing "records a second trace"
[12:38:15 PM] No errors found for "basic.test.ts [chromium]"
[12:38:15 PM] Marking "records a trace" as skipped
[12:38:15 PM] Marking "records a second trace" as passed
[12:38:15 PM] No errors found for "basic.test.ts [chromium]"
[12:38:15 PM] Ending test run basic.test.ts
[12:38:15 PM] [WORKER]  HTML  Report is generated

[12:38:15 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:38:15 PM] [WORKER]  PASS  Waiting for file changes...

[12:38:15 PM] [WORKER]        press h to show help, press q to quit

[12:38:15 PM] [WORKER]  RERUN  basic.test.ts x2 

[12:38:15 PM] [WORKER]         Test name pattern: /^records a second trace$/


[12:38:15 PM] Enqueuing "records a second trace"
[12:38:15 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[INFO 12:38:15 PM] [DECOR] Reset all decorations.
[12:38:15 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:38:15 PM] Ignore "records a trace" during collection
[12:38:15 PM] Enqueuing "records a second trace"
[12:38:15 PM] No errors found for "basic.test.ts [chromium]"
[12:38:15 PM] Marking "records a trace" as skipped
[12:38:15 PM] Marking "records a second trace" as passed
[12:38:15 PM] No errors found for "basic.test.ts [chromium]"
[12:38:15 PM] Ending test run basic.test.ts
[12:38:15 PM] [WORKER]  HTML  Report is generated

[12:38:15 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:38:15 PM] [VSCODE] Flushing 1 deleted items
[12:38:16 PM] [VSCODE] Flushing 8 changed items
[12:38:19 PM] [WORKER] 
[12:38:19 PM] [WORKER]  RERUN  basic.test.ts x3 
        Test name pattern: /^records a second trace$/


[12:38:19 PM] Enqueuing "records a second trace"
[12:38:19 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:38:19 PM] [VSCODE] Flushing 1 changed items
[12:38:41 PM] Ending test run basic.test.ts
[12:38:41 PM] [WORKER]  HTML  Report is generated

[12:38:41 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit

[12:38:41 PM] [WORKER]  RERUN  basic.test.ts x4 

[12:38:41 PM] [WORKER]         Test name pattern: /^records a second trace$/


[12:38:41 PM] Enqueuing "records a second trace"
[12:38:41 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:38:41 PM] Ending test run basic.test.ts
[12:38:41 PM] [WORKER]  HTML  Report is generated

[12:38:41 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit

[12:38:42 PM] [VSCODE] Flushing 9 changed items
[12:38:42 PM] [WORKER] 
[12:38:42 PM] [WORKER]  RERUN  basic.test.ts x5 
        Test name pattern: /^records a second trace$/


[12:38:42 PM] Enqueuing "records a second trace"
[12:38:42 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:38:49 PM] [API] Filtering projects: chromium
[INFO 12:38:49 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:38:49 PM] Enqueuing "records a second trace"
[INFO 12:38:49 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:38:49 PM] [DECOR] Reset all decorations.
[12:38:49 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:38:49 PM] Ignore "records a trace" during collection
[12:38:49 PM] Enqueuing "records a second trace"
[12:38:49 PM] No errors found for "basic.test.ts [chromium]"
[12:38:49 PM] Marking "records a trace" as skipped
[12:38:49 PM] Marking "records a second trace" as passed
[12:38:49 PM] No errors found for "basic.test.ts [chromium]"
[12:38:49 PM] Ending test run basic.test.ts
[12:38:49 PM] [WORKER]  HTML  Report is generated
       You can run npx vite preview --outDir .vitest to see the test results.

[12:38:49 PM] [WORKER]  PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:38:49 PM] Disposing test runner
[12:38:50 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:38:50 PM] [VSCODE] Flushing 8 changed items
[12:38:50 PM] [VSCODE] Flushing 1 deleted items
[12:38:52 PM] Continuous request was cancelled
[12:38:53 PM] Stopping the continuous process because there are no more requests.
[12:38:53 PM] Disposing test runner
[12:38:53 PM] Ending test run basic.test.ts
[12:38:55 PM] [API] Filtering projects: chromium
[INFO 12:38:55 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:38:55 PM] Enqueuing "records a second trace"
[INFO 12:38:55 PM] Running 1 file(s) with name pattern: ^records a second trace$
[INFO 12:38:55 PM] [DECOR] Reset all decorations.
[12:38:55 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:38:55 PM] Ignore "records a trace" during collection
[12:38:55 PM] Enqueuing "records a second trace"
[12:38:55 PM] No errors found for "basic.test.ts [chromium]"
[12:38:55 PM] Marking "records a trace" as skipped
[12:38:55 PM] Marking "records a second trace" as passed
[12:38:55 PM] No errors found for "basic.test.ts [chromium]"
[12:38:55 PM] Ending test run basic.test.ts
[12:38:55 PM] [WORKER]  HTML  Report is generated

[12:38:55 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:38:55 PM] [WORKER]  PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:38:55 PM] Disposing test runner
[12:38:55 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:38:56 PM] [VSCODE] Flushing 8 changed items
[12:38:56 PM] [VSCODE] Flushing 1 deleted items
[12:39:00 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:39:00 PM] [VSCODE] Flushing 9 changed items
[INFO 12:39:01 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:39:01 PM] [API] Spawning on-demand process...
[12:39:01 PM] [API] Filtering projects: chromium
[INFO 12:39:01 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:39:01 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:39:01 PM] [API] On-demand process finished in 413ms
[INFO 12:39:02 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:39:02 PM] [WORKER] 
 DEV  v5.0.0 /Users/vladimir/Projects/vscode/samples/browser-v5
      API started at http://localhost:63315/


[INFO 12:39:02 PM] [RUNNER] Watching test files: basic.test.ts with pattern ^records a trace$|^records a second trace$
[12:39:04 PM] [WORKER] 
[12:39:04 PM] [WORKER]  RERUN  basic.test.ts x1 
        Test name pattern: /^records a trace$|^records a second trace$/


[12:39:04 PM] Enqueuing "records a trace"
[12:39:04 PM] Enqueuing "records a second trace"
[12:39:04 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:39:04 PM] [VSCODE] Flushing 1 changed items
[INFO 12:39:04 PM] [DECOR] Reset all decorations.
[12:39:04 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:39:04 PM] Enqueuing "records a trace"
[12:39:04 PM] Enqueuing "records a second trace"
[12:39:04 PM] No errors found for "basic.test.ts [chromium]"
[12:39:04 PM] Marking "records a trace" as passed
[12:39:04 PM] Marking "records a second trace" as passed
[12:39:04 PM] No errors found for "basic.test.ts [chromium]"
[12:39:04 PM] Ending test run basic.test.ts
[12:39:04 PM] [WORKER]  HTML  Report is generated

[12:39:04 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.

[12:39:04 PM] [WORKER]  PASS  Waiting for file changes...

[12:39:04 PM] [WORKER]        press h to show help, press q to quit

[12:39:04 PM] [WORKER] 
[12:39:04 PM] [WORKER]  RERUN  basic.test.ts x2 
        Test name pattern: /^records a trace$|^records a second trace$/


[12:39:04 PM] Enqueuing "records a trace"
[12:39:04 PM] Enqueuing "records a second trace"
[12:39:04 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[INFO 12:39:04 PM] [DECOR] Reset all decorations.
[12:39:04 PM] No task result for "basic.test.ts [chromium]", ignoring
[12:39:04 PM] Enqueuing "records a trace"
[12:39:04 PM] Enqueuing "records a second trace"
[12:39:04 PM] No errors found for "basic.test.ts [chromium]"
[12:39:04 PM] Marking "records a trace" as passed
[12:39:04 PM] Marking "records a second trace" as passed
[12:39:04 PM] No errors found for "basic.test.ts [chromium]"
[12:39:04 PM] Ending test run basic.test.ts
[12:39:04 PM] [WORKER]  HTML  Report is generated

[12:39:04 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 PASS  Waiting for file changes...
       press h to show help, press q to quit

[12:39:04 PM] [VSCODE] Flushing 8 changed items
[12:39:04 PM] [VSCODE] Flushing 1 deleted items
[12:39:05 PM] [WORKER]  RERUN  basic.test.ts x3 

[12:39:05 PM] [WORKER]         Test name pattern: /^records a trace$|^records a second trace$/


[12:39:05 PM] Enqueuing "records a trace"
[12:39:05 PM] Enqueuing "records a second trace"
[12:39:05 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:39:05 PM] [VSCODE] Flushing 1 changed items
[12:39:10 PM] Ending test run basic.test.ts
[12:39:10 PM] [WORKER]  HTML  Report is generated

[12:39:10 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit

[12:39:10 PM] [WORKER] 
[12:39:10 PM] [WORKER]  RERUN  basic.test.ts x4 
        Test name pattern: /^records a trace$|^records a second trace$/


[12:39:10 PM] Enqueuing "records a trace"
[12:39:10 PM] Enqueuing "records a second trace"
[12:39:10 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:39:10 PM] Ending test run basic.test.ts
[12:39:10 PM] [WORKER]  HTML  Report is generated

[12:39:10 PM] [WORKER]        You can run npx vite preview --outDir .vitest to see the test results.
 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit

[12:39:11 PM] [VSCODE] Flushing 9 changed items
[12:39:11 PM] [WORKER] 
[12:39:11 PM] [WORKER]  RERUN  basic.test.ts x5 
        Test name pattern: /^records a trace$|^records a second trace$/


[12:39:11 PM] Enqueuing "records a trace"
[12:39:11 PM] Enqueuing "records a second trace"
[12:39:11 PM] Starting a test run because basic.test.ts triggered a watch rerun event
[12:39:13 PM] Continuous request was cancelled
[12:39:14 PM] Stopping the continuous process because there are no more requests.
[12:39:14 PM] Disposing test runner
[12:39:14 PM] Ending test run basic.test.ts
[12:39:14 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:39:15 PM] [VSCODE] Flushing 9 changed items
[INFO 12:39:15 PM] [API] Collecting tests: basic.test.ts [chromium]
[12:39:15 PM] [API] Spawning on-demand process...
[12:39:15 PM] [API] Filtering projects: chromium
[INFO 12:39:15 PM] [API] Running Vitest v5.0.0 (browser-v5/vitest.config.ts) with "/Users/vladimir/.nvm/versions/node/v24.13.0/bin/node /Users/vladimir/Projects/vscode/dist/worker.js"
[12:39:15 PM] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[12:39:15 PM] [API] On-demand process finished in 406ms

Extension Version

master

Vitest Version

5.0.0

Validations

sheremet-va avatar Sep 17 '26 10:09 sheremet-va

I tried to reproduce this on current main (v1.52.2) and couldn't: with continuous run on for basic.test.ts in samples/browser-v5, every edit starts one run and that run ends.

Before the Sep 25 fixes it does break: after the second edit an extra run starts and fails with "Browser connection was closed while running tests". At 7c191ab it fails with "Cannot call server.listen in middleware mode" instead, and from 1dd675f on it works, so I think 158d1bd + 1dd675f fixed it (released in v1.52.1).

I wrote an e2e test for it next to the other continuous run tests: it turns on continuous run for the browser-v5 file, edits it twice and checks both runs pass. It fails before those commits and passes on main. Want me to open a PR with it?

nomadical avatar Nov 02 '26 15:11 nomadical