From 8e4f4ecdcb6fd49f987adad5d798124299a08052 Mon Sep 17 00:00:00 2001 From: Ercan Date: Mon, 13 Apr 2026 02:47:37 +0300 Subject: [PATCH] fix(tests): disable fileParallelism to eliminate SIGKILL flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #258 Co-authored-by: Ercan Ermis --- vitest.config.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vitest.config.ts b/vitest.config.ts index 44fe153d..faef384a 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,10 +7,13 @@ export default defineConfig({ // Native addons (better-sqlite3) can segfault in worker_threads during // process cleanup. Use forks on all platforms for stable isolation. pool: "forks", - // Hook subprocess tests (spawnSync + better-sqlite3 native addon) can - // fail intermittently under parallel load on CI. Retry once to absorb - // transient resource-contention failures without masking real regressions. - // Only enable retry on CI to avoid slowing down local dev. - retry: process.env.CI ? 2 : 0, + // Several suites spawn Node subprocesses via spawnSync (hook runners) + // that load the better-sqlite3 native addon. When vitest ran those + // files concurrently in separate fork workers, the child processes + // intermittently received SIGKILL (empty stdout/stderr, status=null) — + // likely from worker-teardown signal propagation under load. + // Serializing files eliminates the race deterministically; tests + // within a file still run sequentially as before (spawnSync is sync). + fileParallelism: false, }, });