test(mcp): de-flake coverage run — bump real-binary spawnSync timeout 5s→15s#42
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The two
BUG-MCP-017tests intest/input-hardening-unit.test.ts(--versionand--help)spawnSyncthe real built binary with a hardtimeout: 5000. Under thenpm 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:nocovstays green and the tests pass in isolation — confirmed an environment flake, not a code defect.Fix
Bump both
spawnSynctimeouts from5000→15000ms via a namedBINARY_SPAWN_TIMEOUT_MSconst. These are the only twospawnSync-the-binary tests with a tight 5s timeout in the suite (integration.test.ts:166uses aspawnSyncaccessSynccheck with no timeout — left untouched).No assertions or behavior changed — only the timeout budget.
Gate
npm run build— cleannpm 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:nocov— 451/451 pass, 0 fail🤖 Generated with Claude Code