From 3783f176a4c56c73856f2599b39fbf164d6ef971 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 13 Feb 2024 09:58:32 -0500 Subject: [PATCH] Deflake test --- store/store_multi_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/store/store_multi_test.go b/store/store_multi_test.go index 4cd06efc..6be265bd 100644 --- a/store/store_multi_test.go +++ b/store/store_multi_test.go @@ -181,9 +181,10 @@ func Test_MultiNodeNode_CommitIndexes(t *testing.T) { // First node to join should also reflect the new cluster config // command. - if exp, got := uint64(5), s1.raft.CommitIndex(); exp != got { - t.Fatalf("wrong commit index, got: %d, exp %d", got, exp) - } + testPoll(t, func() bool { + // The config change command comming through the log due to s2 joining is not instant. + return s1.raft.CommitIndex() == 5 + }, 50*time.Millisecond, 2*time.Second) if exp, got := uint64(4), s1.raftTn.CommandCommitIndex(); exp != got { t.Fatalf("wrong command commit index, got: %d, exp %d", got, exp) }