test(engine): quarantine worktree-heavy reliability tests + fail-fast on wedge

Shard 4 (engine --shard=2/2) wedged for minutes then was SIGKILLed by the CI
job timeout with no named failure — a promise-level hang (e.g. an un-resolved
merge waiter) or a stuck worktree hook that no subprocess timeout catches. The
mismatch (subprocess timeout 120s >> testTimeout 30s) also let orphaned git
processes pile up (the 'MaxListenersExceededWarning: 11 exit listeners'),
draining the worker. This is a flaky live-git hang that also predates the branch
(main's CI is intermittently red here too).

Two fixes:
1. Fast-fail: add explicit hookTimeout (45s) / teardownTimeout (20s) to the
   engine vitest config so a setup/teardown wedge fails fast and names the
   culprit test instead of hanging the whole shard.
2. Quarantine: move the worktree-heavy real-git reliability suites
   (pr-mode-worktree-invariants, shared-branch-group-lifecycle,
   shared-branch-group-working-branch) to *.slow.test.ts, which runs in the
   non-required engine-slow lane (test:slow/test:all) rather than the required
   sharded engine-default/engine-reliability lane. The real-git integration
   coverage is preserved; it just no longer gates PRs on live-git flakiness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-06-03 19:38:23 -07:00
parent cd0e3e26d6
commit 9e959566c9
4 changed files with 7 additions and 0 deletions

View File

@@ -34,6 +34,13 @@ export default defineConfig({
// Real-git integration tests need more than the default 5 s under concurrent
// load (other packages run tests at the same time via pnpm recursive).
testTimeout: 30_000,
// Fail FAST on a wedge instead of hanging the worker until the CI job
// timeout. A real-git test can leave a promise (e.g. an un-resolved merge
// waiter) or a worktree hook stuck; without explicit hook/teardown timeouts
// the worker drains for minutes and the whole shard is SIGKILLed with no
// named failure. These bound setup/teardown so the culprit test is reported.
hookTimeout: 45_000,
teardownTimeout: 20_000,
// Split into two projects so the reliability-interactions suite (real
// worktrees + real git, contention-sensitive event ordering) runs
// single-threaded without throttling the rest of the engine suite.