ci(rate-limit): wait for etherpad readiness before running test#7726
Conversation
The workflow starts the etherpad container in the background, then runs `pnpm install`, then runs the test. On a warm pnpm-store the install can finish before etherpad is listening on 9001, at which point nginx returns 502 for the test request and the run fails. Recent README-only commits on develop hit this race on three consecutive runs. Poll the nginx-proxied endpoint (port 8081 — also what the test uses) until it stops returning 5xx, with a 2-minute timeout and `docker logs etherpad-docker` on giving up to make diagnosis straightforward.
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Review Summary by QodoWait for etherpad readiness before running rate-limit test
WalkthroughsDescription• Adds readiness polling for etherpad container before running tests • Prevents race condition where nginx returns 502 errors • Polls nginx-proxied endpoint until responsive with 2-minute timeout • Outputs docker logs on failure for easier troubleshooting Diagramflowchart LR
A["Start etherpad container"] --> B["Run pnpm install"]
B --> C["Poll nginx endpoint"]
C --> D{Ready?}
D -->|Yes| E["Run rate-limit test"]
D -->|No| F["Output docker logs"]
F --> G["Fail workflow"]
File Changes1. .github/workflows/rate-limit.yml
|
Code Review by Qodo
1. No regression test for race
|
- Name the nginx container so its logs can be captured when the readiness poll times out — previously nginx was started anonymously and a 502 caused by nginx itself (rather than etherpad) would have been hard to diagnose from the workflow log alone. - On timeout also dump `docker ps -a` for container-state visibility. - Tighten the readiness wait: 30 iterations × (1s curl timeout + 1s sleep) gives ~60s budget instead of ~240s, which is still well above observed cold-start time and keeps the failure-fast contract.
|
Addressed Qodo's review in c38e5ea:
|
Summary
Why
Developments three most recent runs of this workflow — all on README-only commits (#7723, #7724, #7725) — failed with the same 502 from nginx upstream. PR #7721 also tripped it three reruns in a row. With a warm pnpm-store, `pnpm install --frozen-lockfile` finishes faster than etherpad can boot inside the container, so the test starts before the upstream is responsive. Polling until nginx stops returning 5xx makes the run deterministic.
Test plan
🤖 Generated with Claude Code