-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Regression: vitest 3.2 hangs when using workspaces, bail and single threaded #8484
Copy link
Copy link
Closed
Copy link
Labels
Description
Describe the bug
When the following conditions are met, the process lives forever:
- Using the latest vitest (3.2)
- With workspaces
- Programmatic API (node API)
- Bail
- Single threaded
- And a test fails in one of the projects
See reproduction example.
Reproduction
Run with node run-vitest.ts. See that the process hangs forever. Reverting back solves this problem npm i -D [email protected].
The run-vitest.ts file looks like this:
import { createVitest } from "vitest/node";
async function runVitest() {
const vitest = await createVitest("test", {
pool: "threads",
poolOptions: {
threads: {
maxThreads: 1,
minThreads: 1,
},
},
bail: 1,
});
await vitest.start();
await vitest.close();
}
runVitest().catch((err) => {
console.error("Vitest run failed:", err);
process.exit(1);
});I would expect the process to always exit, since we're calling vitest.close() (or process.exit(1) in case of an error).
System Info
System:
OS: macOS 15.6.1
CPU: (14) arm64 Apple M4 Pro
Memory: 730.77 MB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.18.0 - ~/.nvm/versions/node/v22.18.0/bin/node
npm: 11.5.2 - ~/.nvm/versions/node/v22.18.0/bin/npm
Browsers:
Chrome: 139.0.7258.154
Edge: 139.0.3405.111
Safari: 18.6
npmPackages:
playwright: ^1.55.0 => 1.55.0
vitest: ^3.2.4 => 3.2.4Used Package Manager
npm
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