SIGN IN SIGN UP

test: deterministic signal readiness + Windows Ctrl-C leg + bounded log-loop test (LEO-415) (#39)

* test: deterministic signal readiness + Windows Ctrl-C leg + bounded log-loop test (LEO-415)

Fix the sigint_exits_130 race: replace the fixed 1 s pre-signal sleep
with a causally-correct readiness gate — watch installs its shutdown
handler strictly before SeqStore::open creates the logs/ state dir, so
polling for that dir proves the signal-to-130 mapping is armed. The
ordering invariant is pinned with comments at both ends.

Add the Windows counterpart: spawn the watcher in its own process group
(CREATE_NEW_PROCESS_GROUP) and deliver a targeted CTRL_BREAK via a
hand-declared GenerateConsoleCtrlEvent (no new dependency), asserting
the same exit-130 contract; skips with a message if the CI shell offers
no shared console to deliver through.

Give logger::run the same injected-source treatment watch --replay has:
extract run_loop (source/clock/wait/shutdown injected; run keeps the
platform gate, live source, real clock, and signal handling), and add a
bounded, clock-injected test proving interval pacing, midnight rotation,
rollover retention, and the sensor filter wired together — the loop
coverage that was previously left to manual Windows verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: fail loudly when CTRL_BREAK delivery fails instead of silently skipping

Review finding (claude-reviewer, PR #39): the skip path was invisible in
CI — libtest captures stderr on passing tests, so 'ok' looked identical
whether the console event was delivered or the test silently skipped —
and it triggered on ANY GenerateConsoleCtrlEvent failure, so a future
delivery regression would quietly erase the Windows exit-130 coverage
while staying green. Panic with the OS error instead: a green run now
proves delivery, and an environment that cannot deliver console events
surfaces loudly for a deliberate descope.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
L
lcj-claude-coder committed
8b76319bfe79d74f655abee3331d39a4af9c9dfd
Parent: 0019eb6
Committed by GitHub <noreply@github.com> on 7/15/2026, 10:56:06 AM