Skip to content

fix(test): the browser suite no longer hangs when a host restarts - #478

Merged
allisonmahmood merged 1 commit into
mainfrom
fix/browser-restart-flake
Oct 2, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
fix/browser-restart-flake

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

main went red right after #475: the newly required browser job'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-node binds a server's port while its layer builds and attaches the request handler only later, in serve. During instance.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 serve attaches 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:browser passes 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.

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]>
@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling size:s Under 100 changed lines labels Oct 2, 2026
@allisonmahmood
allisonmahmood merged commit c56a7b2 into main Oct 2, 2026
11 checks passed
@allisonmahmood
allisonmahmood deleted the fix/browser-restart-flake branch October 2, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant