Skip to content

Commit

Permalink
test: Relax flaky comparison in AsyncWorkQueue parallel test (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccorm4 authored Jul 15, 2024
1 parent a07169e commit 8153c2e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/async_work_queue_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ TEST_F(AsyncWorkQueueTest, WorkerCountInitialized)
<< "Expect 4 worker count for initialized queue";
}


TEST_F(AsyncWorkQueueTest, RunTasksInParallel)
{
auto AddTwoFn = [](const std::vector<int>& lhs, const std::vector<int>& rhs,
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 8153c2e

Please sign in to comment.