Skip to content

test(#117): idle-broadcast cooldown test waits on evidence, appends whichever loop wins - #119

Merged
abogartz merged 1 commit into
mainfrom
test/117-idle-broadcast-race
Oct 26, 2026
Merged

abogartz merged 1 commit into
mainfrom
test/117-idle-broadcast-race

Conversation

@abogartz

Copy link
Copy Markdown
Owner

The idle-broadcast cooldown test had two independent race legs on slow/busy runners, both filed in #117. It reddened Windows CI on #114 (run 40357282402); on macOS we also saw a lone vanishing red under full-suite load consistent with leg 1.

Leg 1 — winner indeterminacy. The harness bus queues each event.subscribe independently, so whichever loop reaches the shared cooldown first pays the model call. Setup b's canned reply was DUP_CONTENT, which the write gate collapses without appending — a b-win left the store at 1 row and reddened the assertion on correct code.

Leg 2 — fixed-sleep completion. waitFor(calls > 0) unblocks at call initiation; a naked sleep(150) then had to cover the whole real-fs chain (parse → runWriteGate incl. locked append → evidence record).

Fix (both legs):

  • Both canned replies are now genuinely new (FRESH_CONTENT / FRESH_CONTENT_B) — the store ends at seed + winner's row whichever loop wins. The pinned invariant is the CALL COUNT; the dedup leg belongs to the gate's own tests.
  • Completion waits on the evidence line (auto_capture_*), which record writes after runWriteGate returns — the same pattern the compaction twin already uses. The sleep(150) survives only as the no-second-fire window, after the first capture is done.

Verified:

  • 12× single-file runs green. (By design the assertion no longer depends on which loop wins; the repeats show no residual timing sensitivity on a fast machine.)
  • Red leg intact: with cooldown temporarily reverted to the pre-capture: captureOnCompact is undocumented, and its cooldown state is per-setup #108 per-setup map, the test fails Expected: 1, Received: 2 (both setups pay).
  • Full suite 496/0/11, tsc clean, biome lint clean.

test: type — no release bump.

Fixes #117.

…pends whichever loop wins

Leg 1: setup b's DUP twin collapsed on a b-win, so the store assertion was
red on correct code whenever the harness queued b's subscriber first.
Both canned replies are now genuinely new - the pinned invariant is the
call count, not the content (dedup has its own gate tests).
Leg 2: waitFor(calls>0) unblocks at call initiation and a naked sleep(150)
had to cover parse -> runWriteGate (locked append) -> evidence; on loaded
Windows runners the append overran. Evidence is recorded after the gate
returns - the compaction twin already uses this completion signal.
Red leg re-verified: per-setup cooldown (pre-#108) -> Expected 1, Received 2.
@abogartz
abogartz merged commit fb500b9 into main Oct 26, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.14.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

capture-compaction idle-broadcast test is flaky on Windows: winner indeterminacy + fixed-sleep completion race

1 participant