From 8153c2eb546ba7ff7f8d11985b009d28a1ab6a53 Mon Sep 17 00:00:00 2001 From: Ryan McCormick Date: Mon, 15 Jul 2024 09:57:57 -0700 Subject: [PATCH] test: Relax flaky comparison in AsyncWorkQueue parallel test (#379) --- src/test/async_work_queue_test.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/async_work_queue_test.cc b/src/test/async_work_queue_test.cc index 1d7b3be90..735086363 100644 --- a/src/test/async_work_queue_test.cc +++ b/src/test/async_work_queue_test.cc @@ -91,7 +91,6 @@ TEST_F(AsyncWorkQueueTest, WorkerCountInitialized) << "Expect 4 worker count for initialized queue"; } - TEST_F(AsyncWorkQueueTest, RunTasksInParallel) { auto AddTwoFn = [](const std::vector& lhs, const std::vector& rhs, @@ -181,10 +180,11 @@ TEST_F(AsyncWorkQueueTest, RunTasksInParallel) .count(); parallelized_duration = end_ts - start_ts; - // FIXME manual testing shows parallelized time is between 30% to 33.3% for - // 128 M total elements - EXPECT_LT(parallelized_duration, serialized_duration / 3) - << "Expected parallelized work was completed within 1/3 of serialized " + // FIXME manual testing shows parallelized time is between 30% to 33.3% + // for 128 M total elements, but is flaky in CI so relax the comparison + // for parallel to simply be faster than serial by any amount. + EXPECT_LT(parallelized_duration, serialized_duration) + << "Expected parallelized work was completed faster than serialized " "time"; for (size_t count = 0; count < task_count; count++) { auto res = std::move(fs[count].get());