-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Error: Terminating worker thread #8564
Copy link
Copy link
Labels
p5-urgentFix build-breaking bugs affecting most users, should be released ASAP (priority)Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Description
Describe the bug
Since vitest4-beta.9 we get an error when running test suites in non-watch mode. Issue does not occur in watch mode.
The tests run fine, but tinypool throws an error when terminating the worker threads.
⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
Error: Terminating worker thread
❯ Object.ThreadTermination ../../node_modules/tinypool/dist/index.js:354:27
❯ ../../node_modules/tinypool/dist/index.js:393:73
❯ processTicksAndRejections node:internal/process/task_queues:95:5
Since that version in non-watch mode minWorkders is automatically set to 0
Using forks, if I revert the change to minThreads, it does not throw an error.
const minThreads
= poolOptions.minThreads ?? vitest.config.minWorkers ?? Math.min(recommendedCount, maxThreads)Reproduction
Could reproduce this on one of my repos. Made a branch chore/vitest4 where I switched to vitest 4 beta 11.
I could look into making this branch more minimal in the weekend, but perhaps it already suffices to diagnose the issue. Had the same issue in other repositories as well.
To reproduce
git clone [email protected]:geersch/retry.git
git checkout chore/vitest4
yarn
yarn test
Or if you just want to run the tests for the retry package. Error only occurs for this one.
...
cd packages/retry
yarn test run
Output
❯ yarn test
Process started
RUN v4.0.0-beta.11
✓ tests/interceptors/retry-interceptor.spec.ts (4 tests) 35ms
Test Files 1 passed (1)
Tests 4 passed (4)
Start at 07:39:06
Duration 252ms (transform 45ms, setup 23ms, collect 134ms, tests 35ms, environment 0ms, prepare 3ms)
Process exited (exit code 0), completed in 0s 568ms
Process started
RUN v4.0.0-beta.11
✓ tests/strategies/fibonacci.backoff-strategy.spec.ts (1 test) 1ms
✓ tests/strategies/decorrelated-jitter.backoff-strategy.spec.ts (1 test) 2ms
✓ tests/strategies/exponential.backoff-strategy.spec.ts (1 test) 1ms
✓ tests/strategies/equal-jitter.backoff-strategy.spec.ts (1 test) 2ms
✓ tests/strategies/fixed.backoff-strategy.spec.ts (1 test) 1ms
✓ tests/strategies/full-jitter.backoff-strategy.spec.ts (1 test) 2ms
✓ tests/strategies/linear.backoff-strategy.spec.ts (1 test) 1ms
⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
Error: Terminating worker thread
❯ Object.ThreadTermination ../../node_modules/tinypool/dist/index.js:354:27
❯ ../../node_modules/tinypool/dist/index.js:393:73
❯ processTicksAndRejections node:internal/process/task_queues:95:5
System Info
System:
OS: macOS 15.6.1
CPU: (14) arm64 Apple M4 Pro
Memory: 2.30 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.19.1 - ~/.nvm/versions/node/v20.19.1/bin/node
Yarn: 4.9.2 - ~/.nvm/versions/node/v20.19.1/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.19.1/bin/npm
Browsers:
Chrome: 140.0.7339.133
Safari: 18.6Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p5-urgentFix build-breaking bugs affecting most users, should be released ASAP (priority)Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Type
Projects
Status
No status