fix(mcp-conformance-fixture): set hookTimeout to match testTimeout - #2241
fix(mcp-conformance-fixture): set hookTimeout to match testTimeout#2241willgriffin wants to merge 1 commit into
Conversation
This suite's expensive work is all in beforeAll: it generates the MCP server, spawns tsx on the generated TypeScript for the stdio transport, completes a protocol handshake, then spawns the HTTP adapter as a second process. The it blocks only POST to that already-running adapter. testTimeout was already 240s, but hookTimeout was left at vitest's 10s default, so the cheap half had the generous budget and the heavy half had none. On a contended runner the hook aborted at 10067ms, reported both tests as skipped, and failed PRs unrelated to MCP: it ejected #2230 from the merge queue and turned #2231 red. Closes #2240
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Updates the @happyvertical/smrt-mcp-conformance-fixture Vitest configuration to prevent nondeterministic CI failures caused by a long-running beforeAll hook timing out under Vitest’s default hook timeout.
Changes:
- Adds
hookTimeout: 240_000to match the already-configuredtestTimeout: 240_000. - Documents why the suite’s timeout budget needs to apply to hooks (the heavy work is in
beforeAll).
| // beforeAll, not in the tests: it generates the MCP server, spawns `tsx` on | ||
| // the generated TypeScript for the stdio transport, completes a protocol | ||
| // handshake, and then spawns the HTTP adapter as a second process. The `it` | ||
| // blocks only POST to that already-running adapter. Left at vitest's 10s |
|
Closing as a duplicate of #2239 — same root cause, same fix, filed ~6 minutes apart by two sessions that hit the ejection independently. Timeline: I filed #2238 at 20:28Z and opened #2239 at 20:35Z; #2240 was filed at 20:37Z and this PR at 20:41Z. Keeping #2239 because it is a strict superset — the same No criticism of the work here — your inline comment is good, and you actually ran the fixture suite locally (2 passed, 3.32s), which is more validation evidence than my PR carries. Nothing is lost by consolidating; the fix is identical. Reopen if you disagree. |
{"schema":"hv-agent-run:v1","runtime":"claude","session":"8a94e288-0358-403f-a3a6-8e81a80e6c5d","issue":"2240","head_sha":"8451eac142f993640ee0e4d512596b1cd141e40d","policy_revision":"1.0.0","status":"complete"}Summary
packages/mcp-conformance-fixturehadtestTimeout: 240_000but nohookTimeout, so itsbeforeAllran against vitest's 10 s default. That is backwards for this suite — theexpensive work is entirely in the hook:
beforeAlltsxon the generated TypeScript (stdio transport), complete a protocol handshake withlistToolsassertions, then spawn the HTTP adapter as a second processitfetchPOST to the already-running adapterSo the cheap half held the 240 s budget and the heavy half held none.
Impact
This is nondeterministic and it failed PRs that have nothing to do with MCP:
feat(fields)) was admitted to the merge queue and then ejected by this intest-packages (2/3)— which is why it silently reverted to CLEAN with no visible cause.fix(core,scanner)) went red onValidate Changes / Affected Build, Typecheck, and Testswith the identical failure.
Both showed:
67 ms over the line, both tests skipped — the failure carried no signal about the code
under test. Because the merge queue runs
mode: fullwhile the PR lane runsmode: affected,a PR could sit at CLEAN and still be ejected on queue entry.
Why match
testTimeoutrather than pick 30 sThe repo's usual value is
hookTimeout: 30000(with60_000inbundle-gate), but thosehooks do not spawn two
tsxprocesses. Matching the value this package already declares forthe same workload avoids inventing a third number, and the hook runs once per suite so there
is no cost to the headroom. It only relaxes a limit — it cannot mask a failure, since an
actually-hung spawn still fails, just later.
Validation
pnpm --filter @happyvertical/smrt-mcp-conformance-fixture test— 2 passed, 3.32 s totalon an idle machine, confirming the hook is normally fast and the 10 s default was marginal
only under CI contention rather than covering a real hang
npx turbo build --filter=@happyvertical/smrt-mcp-conformance-fixture...— 6/6 successfulbiome check— the path is ignored by the repo's Biome config, so no diagnostics applyRelated: #2220 is the same class (permission tests marginal against their timeout, failing the
merge queue nondeterministically).
Closes #2240