Skip to content

test(mcp): de-flake coverage run — bump real-binary spawnSync timeout 5s→15s#42

Merged
mastermanas805 merged 1 commit into
masterfrom
fix/mcp-spawnsync-timeout-flake
Jun 10, 2026
Merged

test(mcp): de-flake coverage run — bump real-binary spawnSync timeout 5s→15s#42
mastermanas805 merged 1 commit into
masterfrom
fix/mcp-spawnsync-timeout-flake

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

What

The two BUG-MCP-017 tests in test/input-hardening-unit.test.ts (--version and --help) spawnSync the real built binary with a hard timeout: 5000. Under the npm test (coverage) variant's V8 instrumentation + full-suite parallel load, the spawned child's cold start can exceed 5s → status: null (killed) → flaky failure on the coverage variant only.

npm run test:nocov stays green and the tests pass in isolation — confirmed an environment flake, not a code defect.

Fix

Bump both spawnSync timeouts from 500015000 ms via a named BINARY_SPAWN_TIMEOUT_MS const. These are the only two spawnSync-the-binary tests with a tight 5s timeout in the suite (integration.test.ts:166 uses a spawnSync accessSync check with no timeout — left untouched).

No assertions or behavior changed — only the timeout budget.

Gate

  • npm run build — clean
  • npm test (coverage variant) — 451/451 pass, 0 fail (run twice; the two binary short-circuit tests pass reliably under load: --version ~625ms, --help ~340ms — well under the new 15s budget)
  • npm run test:nocov451/451 pass, 0 fail

🤖 Generated with Claude Code

…rage run

The two BUG-MCP-017 tests (--version / --help) spawnSync the real built
binary. Under `npm test`'s V8 coverage instrumentation + full-suite parallel
load, the child's cold start can exceed the 5s budget → status:null (killed)
→ flaky FAILURE on the coverage variant only (test:nocov stays green, and the
tests pass in isolation). Confirmed env flake, not a code defect.

Bumps both spawnSync timeouts to 15000ms via a named BINARY_SPAWN_TIMEOUT_MS
const. No assertions or behavior changed — only the timeout budget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit ea8f0cb into master Jun 10, 2026
9 checks passed
@mastermanas805 mastermanas805 deleted the fix/mcp-spawnsync-timeout-flake branch June 10, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant