Skip to content

test(integration): stop mcp-resources flaking on subprocess-spawn timeout#377

Merged
mgoldsborough merged 1 commit into
mainfrom
fix/mcp-resources-flaky-setup
Jun 3, 2026
Merged

test(integration): stop mcp-resources flaking on subprocess-spawn timeout#377
mgoldsborough merged 1 commit into
mainfrom
fix/mcp-resources-flaky-setup

Conversation

@mgoldsborough
Copy link
Copy Markdown
Contributor

What & why

test/integration/mcp-resources.test.ts flaked in CI (seen on #374's run): the beforeAll hit the 5s default hook timeout while spawning its MCP subprocesses ("killed 1 dangling process"), and the afterAll then threw TypeError: undefined is not an object (evaluating 'handle.stop') because handle was never assigned — burying the real cause.

That beforeAll does a lot under the 5s budget: Runtime.start, provisions two workspaces, spawns two Node MCP subprocesses (fixtureSource.start() + otherSource.start()), and startServer. Under CI load the spawn occasionally exceeds 5s.

Change (test-only, no production code)

  • Give the beforeAll/afterAll hooks a 30s timeout — ample headroom for the subprocess spawns without masking a genuine hang.
  • Optional-chain every teardown step (handle?.stop, fixtureSource?.stop, runtime?.shutdown, …) so a partial setup surfaces its true error instead of a misleading teardown TypeError.

Verification

  • bunx tsc --noEmit
  • Ran the file locally → pass, 0 fail each.

Merge this first; it removes the flake that intermittently reds the integration job (including on #374).

…eout

The beforeAll starts a Runtime, provisions two workspaces, and spawns two
Node MCP subprocesses — all under the 5s default hook timeout, which is too
tight under CI load. When it times out, afterAll then throws
`TypeError: undefined is not an object (handle.stop)`, burying the real cause.

Give the hook a 30s timeout and optional-chain every teardown step so a
partial setup fails with its true error instead of a misleading teardown one.
No production code change.
@mgoldsborough mgoldsborough added the qa-reviewed QA review completed with no critical issues label Jun 3, 2026
@mgoldsborough mgoldsborough merged commit a3729f2 into main Jun 3, 2026
5 checks passed
@mgoldsborough mgoldsborough deleted the fix/mcp-resources-flaky-setup branch June 3, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa-reviewed QA review completed with no critical issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant