You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New pool implementation: Timeout terminating forks worker for test files (v4) #8766
Following #8649 and the new pool implementation, I start to see short-running tests start to fail due to running longer than the default 5s test timeout with the following errors:
Test failure output:
Error: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
After run output:
[vitest-pool]: Timeout terminating forks worker for test files /Users/project/test.spec.ts.
[vitest-pool]: Failed to terminate forks worker for test files /Users/project/test.spec.ts. Error: [vitest-pool-runner]: Timeout waiting for worker to respond
at Timeout.<anonymous> (file:///Users/project/node_modules/vitest/dist/chunks/cli-api.BjHteKX0.js:6531:58)
at listOnTimeout (node:internal/timers:608:17)
at process.processTimers (node:internal/timers:543:7)
Additionally, after this issue occurs, node processes remain active that quickly consume a lot of processing power which results in my laptop's fans to spin loudly (which they almost never do).
changed the title [-]New pool implementation: Timeout terminating forks worker for test files[/-][+]New pool implementation: Timeout terminating forks worker for test files (v4)[/+]on Oct 22, 2025
Adding wrapper.unmount to every test fixes this for me. What is the reason that you don't cleanup resources automatically?
The fetch error indicates there was something happening after the test finished running. It's not a global fetch, it's an internal RPC channel being closed. Sometimes it correctly points to the source 😄
I think I found a way to fix it, but we can't fix your tests being flaky. You are asynchronously loading a new route after the test has finished running, so you might get history is not defined for example. To fix this, you need to unmount components.
Although extremely rarely in a project with 81 tests, I do still occasionally have some tests time out at the default 5 seconds with
Error: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
From what I can tell, it's exactly those tests that would've caused the issues as initially reported in this issue. There's no other error output anymore (as of 4.0.1), but I think it's a relatively good bet that it's tests in which there are network requests pending as a test completes.
I'll try and reproduce this in isolation, but the issue is so rare in the project with 81 tests that, presumably, it's too rare in the reproduction to be meaningfully reproducable. So far, I didn't manage and I ran the reproduction tests several dozen times.
In one of my repos on v4, I see persistent timeout being hit after like 100s for tests the completed within 1 second in v3. I have configured testTimeout: 30000, so I find it odd that it can even keep running that long.
Activity
[-]New pool implementation: Timeout terminating forks worker for test files[/-][+]New pool implementation: Timeout terminating forks worker for test files (v4)[/+]sheremet-va commentedon Oct 22, 2025
Adding
wrapper.unmountto every test fixes this for me. What is the reason that you don't cleanup resources automatically?The
fetcherror indicates there was something happening after the test finished running. It's not a globalfetch, it's an internal RPC channel being closed. Sometimes it correctly points to the source 😄sheremet-va commentedon Oct 22, 2025
I think I found a way to fix it, but we can't fix your tests being flaky. You are asynchronously loading a new route after the test has finished running, so you might get
history is not definedfor example. To fix this, you need tounmountcomponents.At least, the hanging will be gone.
kleinfreund commentedon Oct 22, 2025
Good point! The private project I initially encountered this issue in uses
from
@vue/test-utilsin its vitest setup file which I missed in the reproduction. Adding it does indeed stabilize the tests.kleinfreund commentedon Oct 23, 2025
Although extremely rarely in a project with 81 tests, I do still occasionally have some tests time out at the default 5 seconds with
From what I can tell, it's exactly those tests that would've caused the issues as initially reported in this issue. There's no other error output anymore (as of 4.0.1), but I think it's a relatively good bet that it's tests in which there are network requests pending as a test completes.
I'll try and reproduce this in isolation, but the issue is so rare in the project with 81 tests that, presumably, it's too rare in the reproduction to be meaningfully reproducable. So far, I didn't manage and I ran the reproduction tests several dozen times.
silverwind commentedon Oct 23, 2025
In one of my repos on v4, I see persistent timeout being hit after like 100s for tests the completed within 1 second in v3. I have configured
testTimeout: 30000, so I find it odd that it can even keep running that long.