pingqiuandClaude Opus 5.5 90c4fc6cb3 transport: make the C2 dense-LSN edge test deterministic
TestC2_NoGapDenseLSNEdge asserted that a Realtime NotifyAppend at the
dense edge (cursor=10, head=11, lsn=11) emits EmitKindLive, while the
shipper's 2 ms timer drain was running. When a tick landed between
primary.Write and NotifyAppend, the timer shipped lsn 11 from substrate
first (EmitKindBacklog, debt-first per §6.3) and NotifyAppend took the
idempotent skip, so the test saw kind=1. That is correct product
behavior: the entry ships exactly once at the right LSN, and the kind
tag is observability only (WALKindBacklog vs WALKindSessionLive
counters; the LiveTail probe is marker-only).

- TestC2_NoGapDenseLSNEdge now disables the timer drain and drains the
  initial backlog with DrainBacklog, so the Live assertion no longer
  depends on scheduling.
- New TestC2_DenseLSNEdge_TimerWinsRace_ShipsOnce pins the other order
  deterministically: the timer ships the new entry before NotifyAppend
  arrives; NotifyAppend returns nil and does not emit again.

No product change, no timeout changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:58:10 -08:00
Languages
Go 84.7%
Rust 7.7%
Shell 2.7%
templ 1.5%
Java 1%
Other 2.1%