fix(e2e): poll API and middleware readiness instead of fixed sleep#4
Merged
Conversation
/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>
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
/hellothen 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 redmaine2e 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.apps/*.jsonuntil none returns 503 (60s budget), then (2) a behavioral canary — the multi-bundle API must actually injectX-Trace-Idon/multi/headers(30s budget), proving bundle middleware executes, not just that routes exist.Test plan
bash -n e2e/run.shpasses🤖 Generated with Claude Code