Skip to content

Commit 8153c2e

Browse files
authored
test: Relax flaky comparison in AsyncWorkQueue parallel test (#379)
1 parent a07169e commit 8153c2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/async_work_queue_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ TEST_F(AsyncWorkQueueTest, WorkerCountInitialized)
9191
<< "Expect 4 worker count for initialized queue";
9292
}
9393

94-
9594
TEST_F(AsyncWorkQueueTest, RunTasksInParallel)
9695
{
9796
auto AddTwoFn = [](const std::vector<int>& lhs, const std::vector<int>& rhs,
@@ -181,10 +180,11 @@ TEST_F(AsyncWorkQueueTest, RunTasksInParallel)
181180
.count();
182181

183182
parallelized_duration = end_ts - start_ts;
184-
// FIXME manual testing shows parallelized time is between 30% to 33.3% for
185-
// 128 M total elements
186-
EXPECT_LT(parallelized_duration, serialized_duration / 3)
187-
<< "Expected parallelized work was completed within 1/3 of serialized "
183+
// FIXME manual testing shows parallelized time is between 30% to 33.3%
184+
// for 128 M total elements, but is flaky in CI so relax the comparison
185+
// for parallel to simply be faster than serial by any amount.
186+
EXPECT_LT(parallelized_duration, serialized_duration)
187+
<< "Expected parallelized work was completed faster than serialized "
188188
"time";
189189
for (size_t count = 0; count < task_count; count++) {
190190
auto res = std::move(fs[count].get());

0 commit comments

Comments
 (0)