test(wake): #923 de-flake T10 concurrent-enqueue race (deterministic barrier) #926

Merged
Mos merged 1 commits from fix/wake-923-t10-deflake into main 2026-07-26 10:23:08 +00:00

1 Commits

Author SHA1 Message Date
mosaic-coder
f9175c99b6 test(wake): de-flake T10 concurrent-enqueue race — deterministic start-barrier + wait-both (#923)
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
T10 ("two concurrent store.sh enqueue get DISTINCT seqs via flock") launched
its two background enqueues with plain `cmd & cmd & wait` — no guarantee the
scheduler ever actually overlapped them, so the flock contention the test
exists to prove was sometimes never really exercised (or the assertion could
race a not-yet-durable second write), producing an intermittent CI-load flake.

Replace the launch with a deterministic start barrier (flock'd gate file, no
sleep): both children signal a ready marker then block on a shared exclusive
lock; the parent busy-polls (not sleeps) until both markers exist, THEN
releases the gate so both children's pending shared-lock waits are granted
together and they race into store.sh's own enqueue lock for real. Assertions
(distinct+gapless {1,2} seqs, order-independent, both durably enqueued) are
unchanged and still run only after both PIDs have exited.

Verified: 30/30 sequential foreground runs pass (previously intermittent).
RED-catch reproduced 5/5: with _wake_lock_acquire temporarily stubbed to a
no-op, T10 reliably aliases (both enqueues get seq '1') and fails loud,
proving the de-flaked test still catches a real aliasing regression;
restored and reconfirmed GREEN. shellcheck 0.11.0 clean.

Closes #923; Part of #892
2026-07-26 05:04:15 -05:00