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
Flaky test: agy-auth-cache '#1077 re-probes after unauth TTL lapses' races TTL against process-spawn latency #1435
Flake (diagnosed by the bugfix-1433 builder, 2026-08-12; hit PR #1434's CI)
packages/codevagy-auth-cache.test.ts '#1077 re-probes after unauth TTL lapses' sets a 50ms TTL, then awaits runLane - which spawns a process - before asserting the cache entry. Under CI load the spawn exceeds 50ms, the entry expires mid-test, the read returns null, and the assertion fails. Classic TTL-vs-latency race: the test is timing-dependent, not behavior-dependent.
Fix direction
Either inject a fake clock so TTL lapse is deterministic, or split the assertion: one test that the entry exists immediately post-write (no spawn in between), one that an EXPIRED entry re-probes (explicitly aged, not raced). Detail in codev/state/bugfix-1433_thread.md once that lane merges.
Impact
Fails unrelated PRs' Unit Tests job intermittently (observed PR #1434, run 2).
Escalation: this flake has started turning main red, not just PR branches.
At 2026-08-15T01:56:18Z the Tests workflow failed on main at 0fd90b8e0 (the merge commit of PR #1453), and the CI-health cron alerted on it. The failing job was Unit Tests, and the failure is this issue:
FAIL src/commands/consult/__tests__/agy-auth-cache.test.ts
> gemini lane burst behaviour (#1077 regression)
> re-probes after the unauth TTL lapses, recovering once the user signs in
AssertionError: expected null to be 'unauth'
Test Files 1 failed | 244 passed | 3 skipped (248)
Tests 1 failed | 4843 passed | 60 skipped (4904)
One test out of 4,904. PR #1453 was assets plus a render script and touches nothing in the consult lane, and its own full check list was verified green before the merge — so this is the race, not a regression from that PR. Re-running the failed job.
Why the change of venue matters more than the failure rate.
A flake that reds a PR costs a rerun and an architect's attention. A flake that reds main does something worse: it destroys the meaning of the only signal we have for "is trunk healthy". Concretely, in the twenty-four hours around this:
The correct reaction to a genuine red trunk is to stop merging. If a red main is usually this test, the learned reaction becomes to shrug — and the one time it is a real regression, it ships.
That is the failure mode worth pricing in: not the minutes lost to reruns, but the alarm being trained out of usefulness. The same argument was made about afx cleanup reporting a false "not found" (#1445) — our tooling's failure modes keep presenting as findings, and each one that goes unfixed makes the next real finding cheaper to ignore.
Bumping this to the top of the consult queue on that basis. A test asserting behaviour that depends on wall-clock TTL against a spawn whose latency is unbounded in CI cannot be made reliable by tuning the margin; the fix direction is to make the clock injectable so the test controls it, rather than racing it.
Activity
amrmelsayed commentedon Aug 15, 2026
Escalation: this flake has started turning
mainred, not just PR branches.At 2026-08-15T01:56:18Z the
Testsworkflow failed onmainat0fd90b8e0(the merge commit of PR #1453), and the CI-health cron alerted on it. The failing job wasUnit Tests, and the failure is this issue:One test out of 4,904. PR #1453 was assets plus a render script and touches nothing in the consult lane, and its own full check list was verified green before the merge — so this is the race, not a regression from that PR. Re-running the failed job.
Why the change of venue matters more than the failure rate.
A flake that reds a PR costs a rerun and an architect's attention. A flake that reds
maindoes something worse: it destroys the meaning of the only signal we have for "is trunk healthy". Concretely, in the twenty-four hours around this:ghfailure reported as "CI failing on main" — that is af-cron: CI Health Check reports its own command failure as 'CI failing on main' (condition ignores exitCode) #1456), and then fired a true one here. Two alerts, indistinguishable in shape at a glance, one meaningless and one real.mainis usually this test, the learned reaction becomes to shrug — and the one time it is a real regression, it ships.That is the failure mode worth pricing in: not the minutes lost to reruns, but the alarm being trained out of usefulness. The same argument was made about
afx cleanupreporting a false "not found" (#1445) — our tooling's failure modes keep presenting as findings, and each one that goes unfixed makes the next real finding cheaper to ignore.Bumping this to the top of the consult queue on that basis. A test asserting behaviour that depends on wall-clock TTL against a spawn whose latency is unbounded in CI cannot be made reliable by tuning the margin; the fix direction is to make the clock injectable so the test controls it, rather than racing it.