Relationships
≡ duplicate of #3081#3083 Flaky test: WalSink replayed segments are delivered before events written after replay
Opened by hammz · 10/6/2026
Description
Seen once while verifying swamp-club#3078 (an unrelated change that does not touch src/serve/audit_sinks). Running the test directories src/domain/models, src/domain/remote, src/serve and src/worker together, this test failed:
WalSink: replayed segments are delivered before events written after replay (src/serve/audit_sinks/wal_sink_test.ts:242)
The assertion at line 261 failed: wal.segmentCount was 1, expected 0, immediately after sink.flush().
Reproduction
Not deterministic. Six consecutive runs of the file on its own all passed (27 passed, 0 failed). The single failure happened with the wider set of test files running in parallel, on main at f9fbbac1 plus the swamp-club#3078 change.
Suspected cause
The test asserts the segment count straight after flush(), so it may be racing segment cleanup that completes after flush resolves when the machine is loaded. Recent changes in this area: swamp-club#3054 (WAL replay deletes segments only once the store confirms them) and swamp-club#3052 / #3050 (WAL cleanup while running).
Expected
The test passes regardless of load, for example by polling for the segment count with waitFor, or flush() should not resolve until confirmed segments are removed, whichever matches the intended contract.
Closed
No activity in this phase yet.
Sign in to post a ripple.