fix(tests): disable fileParallelism to eliminate subprocess SIGKILL flakiness#259
Open
flightlesstux wants to merge 1 commit intomksglu:mainfrom
Open
Conversation
Several suites spawn Node subprocesses via spawnSync (hook runners) that load the better-sqlite3 native addon. When vitest ran those files concurrently across fork workers, child processes were intermittently SIGKILL'd (empty stdout/stderr, status=null) — signal propagation from worker-teardown under load. Set `fileParallelism: false` so files run sequentially. Tests within a file already run sequentially (spawnSync is synchronous), so the only loss is inter-file concurrency. Also drop the CI-only `retry` that was papering over the symptom. Verified: 3/3 full runs green (44/44 files, ~36s wall time). Fixes mksglu#258 Co-authored-by: Ercan Ermis <eposta@ercanermis.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #258
Summary
spawnSyncsubprocesses in hook suites were externally SIGKILL'd (status=null, signal=SIGKILL, stderr="") when vitest ran their files concurrently across fork workers — signal leaks out of worker-teardown under load.fileParallelism: falseso files execute sequentially. Tests within a file already ran sequentially (spawnSyncis synchronous), so the only thing sacrificed is inter-file concurrency.retry: 2which was masking the race rather than fixing it.Diagnostic Evidence
Single-file runs of every failing suite: green.
Full suite baseline: 6 failed / 45, 12 tests fail, 3 consecutive runs.
With
fileParallelism: false: 45 passed / 45, 3 consecutive runs (36s vs ~10s).Signal was captured by augmenting
runHooktemporarily — subprocess died before producing any output.Trade-off
Local wall-time increases from ~10s to ~36s on an 8-CPU machine. Acceptable for a <1-minute suite in exchange for deterministic green runs on every machine.
A more surgical alternative (vitest projects splitting hook-subprocess suites into their own sequential pool) was considered and rejected — more config surface for a suite that already completes in under a minute.
Test plan
npx vitest run— 3 consecutive full runs, 44/44 files pass, 0 flakesCo-authored-by: Ercan Ermis eposta@ercanermis.com