From 261c08d2fe7b3aa391c5fec6c2681af15ab2a718 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Fri, 28 Jan 2022 19:31:06 +1300 Subject: [PATCH] test: assert on >= 5 rather than strictly == due to process scheduling, we may even receive job_completed messages before the test continues. The assert only needs to check that there are enough messages to prevent invalid indexing. This fixes a flakey test. --- test/laminar-functional.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/laminar-functional.cpp b/test/laminar-functional.cpp index 094361c..e796d26 100644 --- a/test/laminar-functional.cpp +++ b/test/laminar-functional.cpp @@ -178,7 +178,7 @@ TEST_F(LaminarFixture, QueueFront) { ioContext->waitScope.poll(); setNumExecutors(2); ioContext->waitScope.poll(); - ASSERT_EQ(5, es->messages().size()); + ASSERT_GE(es->messages().size(), 5); auto started1 = es->messages().at(3).GetObject(); EXPECT_STREQ("job_started", started1["type"].GetString()); EXPECT_STREQ("bar", started1["data"]["name"].GetString());