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
capture-compaction idle-broadcast test is flaky on Windows: winner indeterminacy + fixed-sleep completion race #117
The test landed with #113 and is flaky on main — any branch that rebases over main can catch it.
Two independent race legs
Winner indeterminacy. The harness bus gives each event.subscribe its own queue (test/harness.ts:72-75), so both setups receive the broadcast; whichever loop reaches the shared cooldown first pays the model call. Setup a carries a FRESH response, setup b carries DUP_CONTENT — the byte-identical twin of the seeded row, which the write gate collapses without appending (gates.ts, dedup_collapse). If b wins, the store legitimately holds 1 row and the store assertion goes red on correct code. The in-line comment claims "seed + ONE row, whichever loop got there first" — only true if either winner would append.
Fixed-sleep completion.waitFor(() => calls.length > 0) unblocks when the mocked generate is initiated; everything downstream — parse, runWriteGate (near-dup scan + append under lock), evidence record — is real async fs bounded only by sleep(150). On a loaded Windows runner the append can take longer; the assertion races it. The compaction twin test is immune because it waits on the evidence line, which is recorded after the gate returns.
Suggested fix
Give both setups distinct FRESH responses: the dedup leg belongs to the gate's own tests; the cooldown test should pass no matter which loop wins.
Replace the naked sleep(150) + immediate store assert with waitFor(() => evidence().some((l) => String(l.ev).startsWith("auto_capture_"))) (evidence lands after the append — deterministic completion), THEN assert calls === 1, then keep a short post-completion sleep window and re-assert calls === 1 so the "no second fire" check stays honest.
Evidence this is not hypothetical
Windows red: run above.
macOS sighting: two full-suite runs on a busy machine showed the same lone red that vanished on three reruns — consistent with leg 1 under load.
Activity
Merge pull request #119 from abogartz/test/117-idle-broadcast-race
test(abogartz#117): the idle-broadcast cooldown test waits on evidenc…
abogartz-opencode-self-improvement commentedon Oct 26, 2026
🎉 This issue has been resolved in version 0.14.6 🎉
The release is available on:
Your semantic-release bot 📦🚀