1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

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.
This commit is contained in:
Oliver Giles 2022-01-28 19:31:06 +13:00
parent 48c0e9340e
commit 261c08d2fe

View File

@ -178,7 +178,7 @@ TEST_F(LaminarFixture, QueueFront) {
ioContext->waitScope.poll(); ioContext->waitScope.poll();
setNumExecutors(2); setNumExecutors(2);
ioContext->waitScope.poll(); ioContext->waitScope.poll();
ASSERT_EQ(5, es->messages().size()); ASSERT_GE(es->messages().size(), 5);
auto started1 = es->messages().at(3).GetObject(); auto started1 = es->messages().at(3).GetObject();
EXPECT_STREQ("job_started", started1["type"].GetString()); EXPECT_STREQ("job_started", started1["type"].GetString());
EXPECT_STREQ("bar", started1["data"]["name"].GetString()); EXPECT_STREQ("bar", started1["data"]["name"].GetString());