From 07c4dcb90c6d97a354d6fdbb371335f0db701a9a Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Wed, 7 Feb 2024 16:23:06 -0800 Subject: [PATCH] tests/e2e: use WaitLeader in corrupt test Signed-off-by: Ivan Valdes --- tests/e2e/corrupt_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/e2e/corrupt_test.go b/tests/e2e/corrupt_test.go index 5f582af2029..b4821f976a9 100644 --- a/tests/e2e/corrupt_test.go +++ b/tests/e2e/corrupt_test.go @@ -320,8 +320,10 @@ func TestCompactHashCheckDetectCorruptionInterrupt(t *testing.T) { _, err = epc.Procs[slowCompactionNodeIndex].Logs().Expect("finished scheduled compaction") require.NoError(t, err, "can't get log indicating finished scheduled compaction") - // Wait for compaction hash check - time.Sleep(checkTime * 5) + // Wait until the leader finished compaction hash check. + leaderIndex := epc.WaitLeader(t) + _, err = epc.Procs[leaderIndex].Logs().Expect("finished compaction hash check") + require.NoError(t, err, "can't get log indicating finished compaction hash check") alarmResponse, err := cc.AlarmList() require.NoError(t, err, "error on alarm list")