Repository navigation
Conversation
The e2e suite failed consistently in CI (all OS/node combos) with "Server did not start within 15000ms", though it passed locally. Two bugs: 1. getFreePort() bound port 0, read the assigned port, closed the socket, then returned the number. Under CI's parallel test execution a sibling grabbed the freed port before the spawned server bound it, so the child hit EADDRINUSE and walked its 1+2+4+8s retry backoff (~15s) -> timeout. 2. `if (args.port)` is a truthy check, so `--port 0` fell through to stdio mode and the server exited immediately. Fix: spawn the server with `--port 0` so the OS assigns an ephemeral port atomically (never freed/re-grabbed), have the server report the actual bound port via httpServer.address(), and parse it from the server log in the test. Also gate HTTP mode on `args.port !== undefined`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dzianisv
marked this pull request as draft
May 29, 2026 21:50
Owner
Author
|
Marking draft. The |
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.
Fixes the last red CI check (
Compile and run tests).Root cause
The e2e suite failed consistently in CI (every OS/node combo) with
Server did not start within 15000ms, yet passed locally. Two bugs:getFreePort()bound port 0, read the port, closed the socket, returned the number. Under CI's parallel test execution a sibling grabbed the freed port before the spawned server bound it → child hitEADDRINUSE→ walked its1+2+4+8sretry backoff (~15s) → the 15s health-poll timed out.--port 0fell through to stdio —if (args.port)is truthy, so port 0 never entered HTTP mode.Fix
Spawn with
--port 0(OS assigns an ephemeral port atomically — never freed/re-grabbed), have the server report the actual bound port viahttpServer.address(), and parse it from the server log in the test. Gate HTTP mode onargs.port !== undefined.This is a fork-only test (added in #4 for the Streamable-HTTP multi-agent feature; not present upstream). Validated locally: build + e2e suite + eslint + prettier all green. Relying on CI matrix to confirm the race fix.
🤖 Generated with Claude Code