ci: retry E2E wrangler boot once with port cleanup#632
Merged
Conversation
The e2e-env server-start step failed twice in two days with "Server failed to start after 180 seconds", cascading to full-suite red — but CI logs show no attempt was actually a slow boot (worst was seconds), so the cause is a transient boot hiccup or a leftover process holding :8788 from a prior step, which more waiting can't fix. Refactor the start into functions and retry the BOOT ONCE (never test failures, which are a separate step): on attempt-1 failure, kill the wrangler process AND any pid still bound to :8788 (wrangler forks esbuild + workerd children that outlive the parent), then relaunch once. A server that truly never starts still fails the job. Budget stays 180s (padding wouldn't help this failure mode); logs surface every 20s. Mirrored into the Makefile e2e-serve target to keep local == CI. Closes #625 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
The E2E
e2e-envcomposite action's "Start Pages Functions server" step failed twice in two days with✗ Server failed to start after 180 seconds, cascading into total-suite red (login + public-timeline all timed out); both #608 and #617 auto-merged over it because e2e isn't a required check, and main's later runs were green — confirming infra flakiness, not code. Investigating the two failed runs' logs showed no attempt was actually a slow boot (worst observed was a few seconds), so the failure mode is a transient boot hiccup or a leftover process holding:8788from a prior step — neither of which more waiting fixes.Fix: refactor the start into functions and retry the boot exactly once, killing the wrangler process and any pid still bound to :8788 (wrangler forks esbuild + workerd children that outlive the parent and would block the re-bind) before relaunching. Retry is scoped to server boot only — test failures are a separate step and are never retried, so a real regression still goes red. A server that genuinely never starts still fails the job after 2 attempts.
Closes #625
What changed
.github/actions/e2e-env/action.ymlstart_wrangler/kill_wrangler/wait_for_serverfunctions; boot-only single retry with port cleanup; logs surfaced every 20s (was 40s); 180s budget unchanged (padding wouldn't fix this failure mode)Makefilee2e-servemirrors the same retry+port-cleanup so localmake e2ematches CISecurity / correctness notes
None — CI harness only. The key correctness property (a truly-down server still fails the job; test failures are never retried/masked) is preserved and called out in the code comment.
Verification
ruby -ryaml)-s bash)e2e-run(tests) is a separate target/step, untouchedBuilt by Sonny · Reviewed by Theo · 🤖 Claude Code