Skip to content

ci: retry E2E wrangler boot once with port cleanup#632

Merged
BreakableHoodie merged 3 commits into
mainfrom
fix/625-e2e-boot-retry
Jul 18, 2026
Merged

ci: retry E2E wrangler boot once with port cleanup#632
BreakableHoodie merged 3 commits into
mainfrom
fix/625-e2e-boot-retry

Conversation

@BreakableHoodie

Copy link
Copy Markdown
Owner

Summary

The E2E e2e-env composite 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 :8788 from 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

File Change
.github/actions/e2e-env/action.yml Start step → start_wrangler/kill_wrangler/wait_for_server functions; boot-only single retry with port cleanup; logs surfaced every 20s (was 40s); 180s budget unchanged (padding wouldn't fix this failure mode)
Makefile e2e-serve mirrors the same retry+port-cleanup so local make e2e matches CI

Security / 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

  • YAML parses (ruby -ryaml)
  • shellcheck clean on the extracted startup script (exit 0, -s bash)
  • Makefile mirror reviewed for parity with the action
  • Retry logic traced: only the boot is retried; e2e-run (tests) is a separate target/step, untouched
  • Can't run GitHub Actions locally; correctness is by inspection + shellcheck per the constraints

Built by Sonny · Reviewed by Theo · 🤖 Claude Code

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>
Copilot AI review requested due to automatic review settings July 18, 2026 11:39
@BreakableHoodie BreakableHoodie added bug Something isn't working priority:p2 Medium priority ci CI/CD workflows and gates labels Jul 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI review requested due to automatic review settings July 18, 2026 11:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 18, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@BreakableHoodie
BreakableHoodie merged commit b70e3c3 into main Jul 18, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci CI/CD workflows and gates priority:p2 Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(e2e): wrangler dev fails to start within 180s — killed two suite runs in two days

2 participants