Repository navigation
fix(test): the browser suite no longer hangs when a host restarts - #478
Merged
Merged
Conversation
A restarting server binds its port before it attaches its request handler, and a request that lands in that gap hangs forever, so the host-restart test waited on a stream that never answered. The harness proxy now answers 502 until the new host announces it is listening, as an ingress that routes only to healthy targets does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
mainwent red right after #475: the newly requiredbrowserjob's "host restart reconnects the loaded document" test timed out waiting for the page to reconnect.The cause is a startup race in the test harness.
@effect/platform-nodebinds a server's port while its layer builds and attaches the request handler only later, inserve. Duringinstance.restart(), the harness proxy forwarded the page's next stream request as soon as the new process accepted connections. The request landed in that gap, got no handler, and hung forever, so the page never reconnected. Under parallel load this reproduced 2 to 4 times in 24 runs.The proxy now answers 502 while a restart is between stopping the old host and the new one announcing it is listening, which happens after
serveattaches the handler. That is what an ingress routing only to healthy targets does. The page's normal backoff then retries against a ready host.Verified: 0 failures in 48 loaded runs of the test, and the full
pnpm test:browserpasses 53/53.Production is barely exposed to this race, because a load balancer only routes to targets that pass a health check, and that check needs the handler.
Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.