Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't terminate workers on Node 14 to not trigger fatal error #2697

Merged
merged 1 commit into from Jan 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/vitest/src/node/pool.ts
Expand Up @@ -128,7 +128,10 @@ export function createPool(ctx: Vitest): WorkerPool {
return {
runTests: runWithFiles('run'),
close: async () => {
await Promise.all(pool.threads.map(w => w.terminate()))
// node before 16.17 has a bug that causes FATAL ERROR because of the race condition
const nodeVersion = Number(process.version.match(/v(\d+)\.(\d+)/)?.[0].slice(1))
if (nodeVersion >= 16.17)
await Promise.all(pool.threads.map(w => w.terminate()))
},
}
}
Expand Down