fix(tests): isolate rate-limit-sensitive invitation tests on own factories #61

Merged
amiryahaya merged 1 commit from fix/invitation-tests-rate-limit-isolation into main 2026-11-05 15:25:46 +01:00
Owner

Follow-up to #60 — fixes the CI failure in run 11393.

Root cause: GetByCode_ExpiredInvitation expected 410 but got 429 on CI — the /code/{code} endpoint's invite-code-lookup window is per-server, and the 1000-guess brute-force test shares the class-fixture server. When CI's test order ran brute-force first, the window was drained before the 410 assertion. Locally the order was luckier — order-coupling, not flakiness.

Fix: each rate-limit-sensitive test gets its own factory fixture (fresh server = fresh window); invitation seeding extracted to a shared InvitationSeeds helper. Suite green ×2 consecutive local runs (774 / 0 / 39).

Follow-up to #60 — fixes the CI failure in run 11393. **Root cause**: `GetByCode_ExpiredInvitation` expected 410 but got **429** on CI — the `/code/{code}` endpoint's `invite-code-lookup` window is per-server, and the 1000-guess brute-force test shares the class-fixture server. When CI's test order ran brute-force first, the window was drained before the 410 assertion. Locally the order was luckier — order-coupling, not flakiness. **Fix**: each rate-limit-sensitive test gets its own factory fixture (fresh server = fresh window); invitation seeding extracted to a shared `InvitationSeeds` helper. Suite green ×2 consecutive local runs (774 / 0 / 39).
fix(tests): isolate rate-limit-sensitive invitation tests on own factories
All checks were successful
API CI / build-and-test (pull_request) Successful in 4m25s
d109bc557a
CI run 11393 failed: GetByCode_ExpiredInvitation expected 410, got 429 —
the /code/{code} endpoint's invite-code-lookup window is per-server, and
the 1000-guess brute-force test sharing the same class fixture had
already drained it when test order differed on the CI runner. Locally
the order was luckier — order-coupling, not flakiness.

- GetByCode_410 test and brute-force test each get their own factory
  fixture (fresh server = fresh rate-limit window)
- invitation seeding extracted to shared InvitationSeeds helper
- suite green x2 consecutive local runs (774 / 0 failed / 39 skipped)
Sign in to join this conversation.
No description provided.