You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(test): Deno API suite is flaky at +/-2, so it cannot detect regressions #478
So results move by about ±2 run to run. Combined with a large standing failure count (~59 on a freshly reset DB, largely the ES256/auth.uid() problem tracked previously), the suite currently cannot distinguish a real regression from noise — which is precisely the situation where a genuine break slips in unnoticed.
Baseline for reference, freshly reset local DB, all 177 migrations, standard seed: 119 passed / 59 failed.
Likely cause: tests share one local database and create/clean fixtures around each other — cleanupCurrentTestData plus markTestStart suggest ordering assumptions that concurrent execution breaks. Worth checking whether Deno's default parallelism is fighting the fixtures.
Why it matters
Any PR touching this API has to hand-diff failure names against a stashed baseline to claim "no new failures", because the counts alone are not trustworthy. That is what I did for #443. It should not be necessary.
Suggested
Make the suite deterministic — per-test schema/transaction isolation, or force serial execution.
Then fix or explicitly skip the standing failures so the suite can gate merges.
Related: #469 covers a similar "tests silently do not run" problem in packages/ui.
Not just the counts — the sets of failing test names are byte-identical across all three. Zero in run 1 that are not in run 3, zero the other way. Whatever produced the ±2 in March is gone, so "make the suite deterministic" is no longer the work.
What is left is worse in a different way: 132 of the 185 failures are a single cause.
101x Auth setup is incomplete. Run auth.test.ts first.
31x Failed to get or create auth token
Those suites call requireAuthSetup() → reads tests/fixtures/tokens.json → written only by auth.test.ts → which fails first, because the magic link it is handed is unparseable:
config.toml:52 is site_url = "env(EXPO_PUBLIC_URL)" and the CLI never substituted it — docker exec supabase_auth_scaffald env shows GOTRUE_SITE_URL=env(EXPO_PUBLIC_URL) literally. pnpm supa reads .env, and EXPO_PUBLIC_URL exists only in .env.template.
So the original diagnosis — shared fixtures fighting Deno's parallelism — was reasonable but is not what is happening. The suite is perfectly repeatable; it is repeatably broken by one unset variable, and the ordering assumption in cleanupCurrentTestData / markTestStart was a red herring.
#710 fixes what can be fixed without restarting someone else's stack:
TEST_USERS.regular used testpassword123; seeds/002a creates the user with test123456. Measured: seeded password → 200, the constant → 400. 185 → 170 from that alone.
TEST_USERS.admin was never created by anything — no [email protected] in auth.users. New seed 002b.
completeMagicLinkAuth() now detects the literal env( and says what is unset, instead of a TypeError that resurfaces 132 times as something else.
Two things this leaves open, both worth deciding on:
tokens.json is a hard ordering dependency — a whole suite hinging on a file one test happens to write. That is fragile regardless of the site_url bug, and is the part of the original "ordering assumptions" instinct that was right.
Cleanup leaks. 16 orphaned ccpa-test-* / deadline-test-* users are sitting in auth.users from earlier runs, so cleanupCurrentTestData's wall-clock window is not catching everything it creates.
Suggest retitling this issue toward the standing failure count, since determinism is now measured and fine.
Activity
fix(test): make the Deno tRPC suite loadable (#480) (#498)
thinkclay commentedon Sep 2, 2026
The ±2 flakiness does not reproduce. Three consecutive runs, same database, nothing changed between them:
Not just the counts — the sets of failing test names are byte-identical across all three. Zero in run 1 that are not in run 3, zero the other way. Whatever produced the ±2 in March is gone, so "make the suite deterministic" is no longer the work.
What is left is worse in a different way: 132 of the 185 failures are a single cause.
Those suites call
requireAuthSetup()→ readstests/fixtures/tokens.json→ written only byauth.test.ts→ which fails first, because the magic link it is handed is unparseable:config.toml:52issite_url = "env(EXPO_PUBLIC_URL)"and the CLI never substituted it —docker exec supabase_auth_scaffald envshowsGOTRUE_SITE_URL=env(EXPO_PUBLIC_URL)literally.pnpm supareads.env, andEXPO_PUBLIC_URLexists only in.env.template.So the original diagnosis — shared fixtures fighting Deno's parallelism — was reasonable but is not what is happening. The suite is perfectly repeatable; it is repeatably broken by one unset variable, and the ordering assumption in
cleanupCurrentTestData/markTestStartwas a red herring.#710 fixes what can be fixed without restarting someone else's stack:
TEST_USERS.regularusedtestpassword123;seeds/002acreates the user withtest123456. Measured: seeded password → 200, the constant → 400. 185 → 170 from that alone.TEST_USERS.adminwas never created by anything — no[email protected]inauth.users. New seed002b.completeMagicLinkAuth()now detects the literalenv(and says what is unset, instead of aTypeErrorthat resurfaces 132 times as something else.Two things this leaves open, both worth deciding on:
tokens.jsonis a hard ordering dependency — a whole suite hinging on a file one test happens to write. That is fragile regardless of the site_url bug, and is the part of the original "ordering assumptions" instinct that was right.ccpa-test-*/deadline-test-*users are sitting inauth.usersfrom earlier runs, socleanupCurrentTestData's wall-clock window is not catching everything it creates.Suggest retitling this issue toward the standing failure count, since determinism is now measured and fine.
test(harness): the Deno suite is not flaky — it is 132 failures from …
ci(api): gate the build on HTTP api tests, via a list that may only g…
fix(test): repair the shared api test fixtures, and gate 19 files ins…
fix(test): repair the shared api test fixtures — 249 failures to 95 (#…