From 9efb5b8c515faa102c02e38c9616e54831205321 Mon Sep 17 00:00:00 2001 From: sumeerbhola Date: Wed, 20 Nov 2024 21:22:39 -0500 Subject: [PATCH] wal: reduce flake in TestConcurrentWritersWithManyRecords Informs #4035 --- wal/failover_writer_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wal/failover_writer_test.go b/wal/failover_writer_test.go index 9bbf81e511..cd0e8a6770 100644 --- a/wal/failover_writer_test.go +++ b/wal/failover_writer_test.go @@ -663,6 +663,9 @@ func TestConcurrentWritersWithManyRecords(t *testing.T) { if i > 0 && i%switchInterval == 0 { dirIndex = (dirIndex + 1) % 2 ww.switchToNewDir(dirs[dirIndex]) + // switchToNewDir does not synchronously create the new writer, so wait + // until the writer is created. + <-logWriterCreated } } time.Sleep(5 * time.Millisecond)