Summary
The E2E global-setup.ts prerequisite check intermittently reds a shard when a Supabase auth admin-API call transiently times out — surfacing as an empty {} error. It is not a corrupted user and not the failing PR's diff; the same shared users are healthy. Under the full 28-shard push-to-main matrix (chromium + firefox + webkit), the concurrent load spikes the auth admin API and a single transient failure fails that shard's entire setup, red-lining main until a re-run.
This is the second, distinct failure mode from #338's shared-user corruption (where the user signs in fine but has no profile/keys → 406). Here the admin API call itself errors {}.
Evidence (2026-07-24, shipping #321 / PR #344)
- PR run
30091431004 (chromium-only): chromium-msg + chromium-msg-iso failed at global-setup:
❌ PRIMARY user sign-in failed: {} (~50s), while all 6 chromium-gen shards + the RLS/conformance gate passed. Re-ran → green.
- Post-merge run
30094104243 on f597f369 (full 28-shard):
webkit-gen 3/6, firefox-gen 3/6: ❌ Could not verify PRIMARY/TERTIARY exists — listUsers error: {} (~26s)
chromium-gen 4/6: payment/06-realtime-dashboard.spec.ts:124 60s timeout (co-occurring flaky-watch under the same load)
- Re-ran the 4 failed jobs → green.
- Users verified healthy throughout: direct GoTrue password grant for both PRIMARY and TERTIARY returned HTTP 200 (
curl -4 …/auth/v1/token?grant_type=password). The {} was a transient admin-API timeout, not a missing/corrupted user.
Root cause
tests/e2e/global-setup.ts makes three admin-API calls whose transient failure pushes a hard prereq error (→ throw at L232, aborting the shard), with no retry:
- L86 —
adminClient.auth.admin.listUsers({ perPage: 1 }) connectivity probe (catch at L96).
- L138-183 — per-user existence check via paginated
listUsers; a listUsers error becomes enumerationError → Could not verify ${name} exists — listUsers error: {} (L171).
- L197-220 — PRIMARY
signInWithPassword verify → PRIMARY user sign-in failed: {} (L215).
#338 deliberately made a listUsers error fail loudly instead of destructively recreating the shared user (the right call — that recreate path is what corrupted the user). But "fail loudly" on a transient now reds the shard for a non-issue. The missing piece is retry/backoff: distinguish "the API blipped" from "the prerequisite is genuinely unmet."
Proposed fix
- Wrap each of the three admin-API calls (connectivity
listUsers, per-user listUsers, PRIMARY signInWithPassword) in a retry-with-backoff helper (e.g. 3 attempts, 2-4s backoff) before recording a prereq error. Only an error that persists across retries should red the shard. Empty/{}/timeout errors are exactly the retryable class.
- Consider staggering global-setup start or lowering shard concurrency so 28 shards don't hit the auth admin API simultaneously (secondary — the retry is the primary fix).
- Keep
payment/06-realtime-dashboard.spec.ts on the flaky-watch (its 60s timeout co-occurs under the same load).
Acceptance
Refs
Summary
The E2E
global-setup.tsprerequisite check intermittently reds a shard when a Supabase auth admin-API call transiently times out — surfacing as an empty{}error. It is not a corrupted user and not the failing PR's diff; the same shared users are healthy. Under the full 28-shard push-to-main matrix (chromium + firefox + webkit), the concurrent load spikes the auth admin API and a single transient failure fails that shard's entire setup, red-liningmainuntil a re-run.This is the second, distinct failure mode from #338's shared-user corruption (where the user signs in fine but has no profile/keys → 406). Here the admin API call itself errors
{}.Evidence (2026-07-24, shipping #321 / PR #344)
30091431004(chromium-only):chromium-msg+chromium-msg-isofailed at global-setup:❌ PRIMARY user sign-in failed: {}(~50s), while all 6chromium-genshards + the RLS/conformance gate passed. Re-ran → green.30094104243onf597f369(full 28-shard):webkit-gen 3/6,firefox-gen 3/6:❌ Could not verify PRIMARY/TERTIARY exists — listUsers error: {}(~26s)chromium-gen 4/6:payment/06-realtime-dashboard.spec.ts:12460s timeout (co-occurring flaky-watch under the same load)curl -4 …/auth/v1/token?grant_type=password). The{}was a transient admin-API timeout, not a missing/corrupted user.Root cause
tests/e2e/global-setup.tsmakes three admin-API calls whose transient failure pushes a hard prereq error (→throwat L232, aborting the shard), with no retry:adminClient.auth.admin.listUsers({ perPage: 1 })connectivity probe (catch at L96).listUsers; alistUserserror becomesenumerationError→Could not verify ${name} exists — listUsers error: {}(L171).signInWithPasswordverify →PRIMARY user sign-in failed: {}(L215).#338 deliberately made a
listUserserror fail loudly instead of destructively recreating the shared user (the right call — that recreate path is what corrupted the user). But "fail loudly" on a transient now reds the shard for a non-issue. The missing piece is retry/backoff: distinguish "the API blipped" from "the prerequisite is genuinely unmet."Proposed fix
listUsers, per-userlistUsers, PRIMARYsignInWithPassword) in a retry-with-backoff helper (e.g. 3 attempts, 2-4s backoff) before recording a prereq error. Only an error that persists across retries should red the shard. Empty/{}/timeout errors are exactly the retryable class.payment/06-realtime-dashboard.spec.tson the flaky-watch (its 60s timeout co-occurs under the same load).Acceptance
{}/timeout on any of the three admin-API calls no longer fails a shard's setup (retried).Refs
FLAKY_GATE_MODE=annotateine2e.ymluntil this is hardened; this is a real recurring source ofmain-red-then-green-on-rerun.lesson_e2e_shared_user_corruption.mddocuments how to tell the two modes apart.