carlos / platform Public

Flaky: sim/litestreamfacts TestGate_AnchoredLineageThroughStore under load open

TestGate_AnchoredLineageThroughStore failed once in a full gate run on DOCS-T1 on 2026-10-09 at 00:13. The load average was about 6-11. It passed in three straight reruns, and it passes in CI.

facts_test.go:826: GATE round 1: position 18, rows 15; ... L9 [1,17] [1,18]
facts_test.go:831: round 1: snapshot retention did not leave exactly the newest snapshot: L9 [1,17] [1,18]

It looks like a timing race: the test checks snapshot retention before litestream's retention pass has removed the older L9 snapshot. Main's f36718c5 (#263, hibernate retention) touches snapshot retention, so it is worth checking whether that widens the window. The failure was seen on moves-phase1-4 at 3f7db3a8, which predates the merge of f36718c5 and does not touch internal/sim.

Fixed on branch test-suite-debt (ce7b9441), CI green, not merged.

Cause. The test waited for len(L9) == 1, then closed the store and asserted the same. One snapshot is not a stable state: the monitor snapshots every 300 ms and deletes those older than 400 ms, so a tick 100 ms late removes the previous snapshot and leaves one behind the position; the next tick adds the final one beside it, and the store closed before a third tick. Replaying the monitor's two calls by hand with one late tick gives [1,3], then [1,3] [1,4], then [1,4]: the reported L9 [1,17] [1,18] shape.

Fix. The wait is for one snapshot whose MaxTXID equals the position, same 5s deadline.

f36718c5 does not widen the window, as asked above: it touches internal/lease, internal/ops and the README; this test builds its own store with its own intervals.

Aside, not changed: the test's comment says its intervals keep production's shape, but production retention is now 7x the interval and the test uses 1.33x.