From 9e959566c9e3b6589af0097e2975c56014938f3b Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 3 Jun 2026 19:38:23 -0700 Subject: [PATCH] test(engine): quarantine worktree-heavy reliability tests + fail-fast on wedge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- ...ts.test.ts => pr-mode-worktree-invariants.slow.test.ts} | 0 ....test.ts => shared-branch-group-lifecycle.slow.test.ts} | 0 ....ts => shared-branch-group-working-branch.slow.test.ts} | 0 packages/engine/vitest.config.ts | 7 +++++++ 4 files changed, 7 insertions(+) rename packages/engine/src/__tests__/reliability-interactions/{pr-mode-worktree-invariants.test.ts => pr-mode-worktree-invariants.slow.test.ts} (100%) rename packages/engine/src/__tests__/reliability-interactions/{shared-branch-group-lifecycle.test.ts => shared-branch-group-lifecycle.slow.test.ts} (100%) rename packages/engine/src/__tests__/reliability-interactions/{shared-branch-group-working-branch.test.ts => shared-branch-group-working-branch.slow.test.ts} (100%) diff --git a/packages/engine/src/__tests__/reliability-interactions/pr-mode-worktree-invariants.test.ts b/packages/engine/src/__tests__/reliability-interactions/pr-mode-worktree-invariants.slow.test.ts similarity index 100% rename from packages/engine/src/__tests__/reliability-interactions/pr-mode-worktree-invariants.test.ts rename to packages/engine/src/__tests__/reliability-interactions/pr-mode-worktree-invariants.slow.test.ts diff --git a/packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.test.ts b/packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.slow.test.ts similarity index 100% rename from packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.test.ts rename to packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.slow.test.ts diff --git a/packages/engine/src/__tests__/reliability-interactions/shared-branch-group-working-branch.test.ts b/packages/engine/src/__tests__/reliability-interactions/shared-branch-group-working-branch.slow.test.ts similarity index 100% rename from packages/engine/src/__tests__/reliability-interactions/shared-branch-group-working-branch.test.ts rename to packages/engine/src/__tests__/reliability-interactions/shared-branch-group-working-branch.slow.test.ts diff --git a/packages/engine/vitest.config.ts b/packages/engine/vitest.config.ts index 4647a84b16..7ccec53dcc 100644 --- a/packages/engine/vitest.config.ts +++ b/packages/engine/vitest.config.ts @@ -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.