test: stabilize restart rebind transport harness (#163) - #282
Merged
Merged
Conversation
This was referenced Sep 26, 2026
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.
Closes the remaining deterministic test-harness gap exposed while qualifying #163 host restart/rebind behavior.
The production MCP/OAuth semantics are unchanged. The #159 restart test intentionally tears down one HTTP server and starts a replacement on the same TCP port. Node/undici may otherwise reuse a dead keep-alive socket from the previous listener and raise
ECONNRESETbefore the replacement server receives the request. The harness now sendsConnection: closeon its direct HTTP MCP requests so the test measures DevSpace session/rebind behavior rather than client-pool socket reuse.A/B evidence on clean main:
ECONNRESETafter the second-generation listener shuts down;Connection: close: PASS.Exact Candidate:
3ca5786ba9d2ad9446e1325d76e48a6424cf9cae;e23e2539f151c9c5674268191fb848d639a33c8e;src/server.test.ts;Verification:
src/server.test.ts: 84/84 PASS;npm run typecheck: PASS;npm run build: PASS;git diff --check: PASS.This does not weaken stale-session, OAuth replay, token/client/resource binding, or reconnect failure behavior.