You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cap vitest workers (maxWorkers=4) so test runs don't saturate the dev box #8
A full vitest run uses one fork worker per core by default. On the 12-core WSL box, a single run from a Claude worktree (claude-20261014-114836-915, 2026-10-14) started 10+ node (vitest N) workers, pushed the load average to 17, and slowed every other session and shell. Memory and IO were fine; the cause was CPU saturation alone.
Proposed fix
Cap the workers in vitest.config.mts (the shared base that vitest.workspace.mts extends):
test: {maxWorkers: 4,// ...}
Notes
Check that the cap reaches both workspace projects (engine and viewer), and that it works with poolOptions.forks under the installed vitest version.
This is a fork that syncs from upstream. A hardcoded value in the shared config may conflict on fork-sync. Another option: read it from an env var (maxWorkers: process.env.VITEST_MAX_WORKERS ?? undefined) and set that var locally, so CI and upstream keep their defaults.
Measure the full-suite wall time before and after, so the slowdown is known.
Update (2026-10-14): maxWorkers alone crashes the pool on vitest 2.1.9
Setting only maxWorkers fails before any test runs:
RangeError: options.minThreads and options.maxThreads must not conflict
❯ new Tinypool node_modules/tinypool/dist/index.js:745:120
❯ createForksPool node_modules/vitest/dist/chunks/resolveConfig.rBxzbVsl.js:6756:16
vitest then prints Test Files no tests and exits. A script that only greps the summary can read that as a pass. The cause: the default minWorkers is based on the core count (11 on this 12-core box), which is above the cap.
Set both, on the command line or in config:
npx vitest run --minWorkers=1 --maxWorkers=4
test: {minWorkers: 1,maxWorkers: 4}
The CLI form needs no change to the shared config, so it can't conflict on fork-sync.
Closing: no change needed. Upstream moved to Vitest 4 (vitest ^4.1.11, merged into fork main in 10c0278), which removed --minWorkers, so the Tinypool minThreads/maxThreads conflict this issue documents cannot happen any more. npx vitest run --maxWorkers=4 alone ran the full suite on 2026-11-05 (887 test files, 10523 tests passed). The cap stays a command-line flag, so nothing in the shared config can conflict on sync.
Activity
inth3shadows commentedon Nov 5, 2026
Closing: no change needed. Upstream moved to Vitest 4 (
vitest ^4.1.11, merged into fork main in 10c0278), which removed--minWorkers, so the TinypoolminThreads/maxThreadsconflict this issue documents cannot happen any more.npx vitest run --maxWorkers=4alone ran the full suite on 2026-11-05 (887 test files, 10523 tests passed). The cap stays a command-line flag, so nothing in the shared config can conflict on sync.