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: system-restart drain timer asserts an exact 60000 against an absolute deadline #1045
and the remaining budget is derived from a later clock read. One millisecond elapsing between the two is correct behavior — the deadline is absolute, so the scheduled delay shrinks to match it. The test asserts on the delay as if it were a constant.
Why it is worth fixing rather than rerunning
This is the same family as #1042: an assertion coupled to nondeterminism it does not intend to test, so it reddens CI without evidence of a defect, and it would not notice a real regression in the property it claims to guard. A drain that scheduled 30000 would still be caught, but one that drifted by a few hundred milliseconds under load would be indistinguishable from this noise.
Suggested fix
Either inject the clock so both reads return the same value, or assert the invariant the code actually maintains — that the scheduled delay is within a small tolerance of the remaining budget, and never exceeds it.
Found while verifying #1022 against current dev; not caused by it.
The assertion this issue reports is real, and the diagnosis in it is correct: production computes the drain delay by subtracting a later clock reading from an absolute deadline, so a live clock advancing by 1 ms yields 59999 and an exact toBe(MEMORY_DRAIN_RESTART_MS) would flake.
4177345021 closed that by injecting a fixed now into the test at tests/system-restart.test.ts:330 and :343, which makes the exact assertion at :363 deterministic without weakening it to a range.
Ancestry and suite, verified against origin/dev = aaa71967a:
$ git merge-base --is-ancestor 4177345021 origin/dev;echo$?0
$ bun test tests/system-restart.test.ts 24 pass 0 fail 68 expect() calls
Activity
github-actions commentedon Aug 5, 2026
Automated translation bookkeeping — detected language: unknown.
lidge-jun commentedon Aug 5, 2026
Fixed on
dev— closing.The assertion this issue reports is real, and the diagnosis in it is correct: production computes the drain delay by subtracting a later clock reading from an absolute deadline, so a live clock advancing by 1 ms yields
59999and an exacttoBe(MEMORY_DRAIN_RESTART_MS)would flake.4177345021closed that by injecting a fixednowinto the test attests/system-restart.test.ts:330and:343, which makes the exact assertion at:363deterministic without weakening it to a range.Ancestry and suite, verified against
origin/dev = aaa71967a:Triage record:
devlog/_plan/260805_issue_pr_triage/010_issue_verdicts.md.docs(devlog): triage every open bug issue and PR against dev
docs(devlog): record the one close and three review requests
docs(devlog): triage every open bug issue and PR against dev
docs(devlog): record the one close and three review requests