Skip to content

fix(e2e): poll API and middleware readiness instead of fixed sleep#4

Merged
sedkis merged 1 commit into
mainfrom
fix/e2e-readiness-poll
Jul 15, 2026
Merged

fix(e2e): poll API and middleware readiness instead of fixed sleep#4
sedkis merged 1 commit into
mainfrom
fix/e2e-readiness-poll

Conversation

@sedkis

@sedkis sedkis commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The e2e harness waited for /hello then slept a fixed 2 seconds before running tests. Bundles load asynchronously, so on slow runners the suite starts while APIs still return 503 — this is the failure mode of the two red main e2e runs (Jul 14: all six tests 503; Jun 17: three tests where APIs responded but middleware hadn't attached yet). Same starter code and same pinned gateway ref passed on the PR branch, confirming a timing race rather than a code regression.
  • Replaces the sleep with two readiness gates: (1) poll every API listen path from apps/*.json until none returns 503 (60s budget), then (2) a behavioral canary — the multi-bundle API must actually inject X-Trace-Id on /multi/headers (30s budget), proving bundle middleware executes, not just that routes exist.
  • On timeout, dumps the last 30 gateway log lines and tears down, so a genuine failure is diagnosable instead of surfacing as six confusing test failures.

Test plan

  • bash -n e2e/run.sh passes
  • The real validation is this PR's own e2e workflow run, which exercises the full harness against the goja gateway image

🤖 Generated with Claude Code

/hello returns 200 before bundles finish loading, so the fixed 2s sleep
races on slow runners: APIs 503 (all-fail mode, Jul 14 main run) or
serve briefly without middleware (partial-fail mode, Jun 17 main run).
Poll every API's listen path until it stops returning 503, then gate on
a behavioral canary (multi-bundle must inject X-Trace-Id) before
running tests, with gateway logs dumped on timeout.

Co-Authored-By: Claude <noreply@anthropic.com>
@sedkis
sedkis merged commit 8e3068f into main Jul 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant