Skip to content

Commit

Permalink
fix: don't terminate workers on Node 14 to not trigger fatal error (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Jan 18, 2023
1 parent 859e7f0 commit db9b6bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vitest/src/node/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,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

0 comments on commit db9b6bb

Please sign in to comment.