Fixed on main as b413290 (branch fix-1193-wal-close-test, Astra READY, census APPROVE on #280, CI green). The cause was real: the HA fence gate refused a Litestream snapshot write without closing its pipe, so the WAL could stay open (#811). The gate now closes the pipe on every write it handles, and both WAL tests wait on the descriptor count with a 30 s guard. Not released.
Flake: TestDrainReleaseSnapshotEarlyRefusalReleasesTheWAL 2 s WAL-close deadline closed
TestDrainReleaseSnapshotEarlyRefusalReleasesTheWAL (internal/lease/releasesnapshottest.go:268) failed once on main 03ff5d1, job before 6497. The same tree had passed on the branch tip 3b028802, and the rerun (job 6497) passed.
The check gives the snapshot encoder 2 s to close app.db-wal, polling /proc/self/fd. The gate reported the machine 79% busy and this shard at about 24.5 of 32 cores. That points to a timing margin, not a code fault.
Suggested fix: wait on the release's own completion signal instead of a fixed 2 s deadline, or raise the deadline. Not fixed on the ha-generations branch.