-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)
Description
Describe the bug
When running Vitest in run-mode and doing a non-graceful exit with CTRL+c, the forks workers are sometimes left running in the background even though main process exits.
In my case I'm not spawning any additional processes during the test run. Graceful exit in watch-mode kills the worker properly.
Reproduction
Reproduces the issue but is not (yet) minimal one:
- Git checkout https://github.com/AriPerkkio/ast-v8-to-istanbul
pnpm install; pnpm buildpnpm run test test/convert.e2e.ts- Hit CTRL+c
- Check running
nodeprocesses, look for theforks.jsfrom Vitest
vitest-fork-zombie.webm
System Info
System:
OS: macOS 15.6.1
CPU: (8) arm64 Apple M2
Memory: 444.67 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 22.18.0 - /Users/ari/.nvm/versions/node/v22.18.0/bin/node
npm: 11.6.0 - /Users/ari/.nvm/versions/node/v22.18.0/bin/npm
pnpm: 10.23.0 - /Users/ari/.nvm/versions/node/v22.18.0/bin/pnpm
bun: 1.2.21 - /Users/ari/.bun/bin/bun
Deno: 2.3.6 - /Users/ari/.deno/bin/deno
Browsers:
Brave Browser: 131.1.73.101
Chrome: 142.0.7444.176
Firefox: 135.0
Safari: 18.6
npmPackages:
@vitejs/plugin-vue: ^6.0.2 => 6.0.2
@vitest/coverage-istanbul: ^4.0.13 => 4.0.13
@vitest/coverage-v8: ^4.0.13 => 4.0.13
vite: ^7.2.4 => 7.2.4
vitest: ^4.0.13 => 4.0.13Used Package Manager
pnpm
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
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)
Type
Projects
Status
Approved