From 225d7c700ef4b801473d160bf2cf15860141b7ee Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Fri, 2 Oct 2026 13:07:07 -0700 Subject: [PATCH] Check that a tick flushes the records writer's session With the harness flushing directly, no test showed a tick writing anything (Greptile). The one test that keeps a tick now waits for the record its stuck flush writes once the publisher answers, which also proves the hub was not blocked by a flush that never started. --- pkg/captions/records/writer_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/captions/records/writer_test.go b/pkg/captions/records/writer_test.go index 06de31ee8..9175d6c8f 100644 --- a/pkg/captions/records/writer_test.go +++ b/pkg/captions/records/writer_test.go @@ -570,6 +570,9 @@ func TestWriterNeverBlocksTheHub(t *testing.T) { t.Fatal("the hub was held up by a writer that is stuck on the PDS") } close(h.repos.block) + // Before the session ends, only the tick's flush, held in the publisher + // until now, can write a record. + require.Eventually(t, func() bool { return len(h.repos.written()) > 0 }, 5*time.Second, time.Millisecond, "a tick flushes the session") } func TestWriterIndexesWhatItWrites(t *testing.T) { -- knotmirror 0.0.1