diff --git a/packages/vitest/src/node/pool.ts b/packages/vitest/src/node/pool.ts index 457d65cac2c0..6561b2436edd 100644 --- a/packages/vitest/src/node/pool.ts +++ b/packages/vitest/src/node/pool.ts @@ -127,7 +127,9 @@ export function createPool(ctx: Vitest): WorkerPool { return { runTests: runWithFiles('run'), - close: async () => {}, // TODO: not sure why this will cause Node crash: pool.destroy(), + close: async () => { + await Promise.all(pool.threads.map(w => w.terminate())) + }, } }