fix(e2e): share one disposable account + skip on registration 429 #223
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-196-e2e-register-budget"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The email-driven specs (magic-link, password-reset, change-email) each registered their own disposable account, so a full run did 3 POST /v1/auth/register calls. bunyip caps registration at 3/hour/IP (RateLimitConfig::REGISTRATION), so the suite sat exactly at the cap: any Playwright retry or a back-to-back CI run on the shared runner egress IP tripped a 429 at registerDisposable (e2e/lib/accounts.ts), which is what failed e2e.yml run #977.
Consolidate the three flows into one serial describe (e2e/tests/auth/email-flows.spec.ts) that registers a single disposable account in beforeAll and mutates it in turn (magic-link is non-destructive, password-reset rotates the password, change-email rotates the email, threading the current credentials forward). One registration per run instead of three leaves head-room for reruns.
Because the suite runs against a persistent staging deployment from one shared CI IP and e2e.yml serialises runs without spacing them an hour apart, sibling runs in the same hour can still exhaust the per-IP budget. registerDisposable now raises a typed RegistrationRateLimitedError on HTTP 429 and the spec SKIPS rather than fails when it sees one: a rate-limited window is outside this run's control, while a genuine registration outage is a non-429 status and still fails the suite.
Validated with
tsc --noEmitandplaywright test --list(the e2e suite is TypeScript; it has no Rust to run throughjust check).#BUNYIP-196
Pull request closed