Skip to content

Commit

Permalink
fix: crash with odd cpu counts (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
hira committed Jul 5, 2022
1 parent 2a88078 commit 0a642c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest/src/node/pool.ts
Expand Up @@ -23,7 +23,7 @@ const workerPath = pathToFileURL(resolve(distDir, './worker.mjs')).href

export function createPool(ctx: Vitest): WorkerPool {
const threadsCount = ctx.config.watch
? Math.max(cpus().length / 2, 1)
? Math.max(Math.floor(cpus().length / 2), 1)
: Math.max(cpus().length - 1, 1)

const maxThreads = ctx.config.maxThreads ?? threadsCount
Expand Down

0 comments on commit 0a642c6

Please sign in to comment.