Skip to content

Commit

Permalink
Fix flaky Stopwatch test (#610)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Jul 17, 2024
1 parent 2b8a2bb commit 0925141
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Stopwatch_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ TEST(Stopwatch, StartStopReset)
watch.Start(true);
EXPECT_TRUE(watch.Running());
EXPECT_LT(watch.StopTime(), watch.StartTime());
// Add a small sleep to make sure that there's is some time elapsed between
// calling Start(true) above and ElapsedRunTime() below.
std::this_thread::sleep_for(std::chrono::microseconds(1));
EXPECT_NE(steady_clock::duration::zero(), watch.ElapsedRunTime());
EXPECT_EQ(steady_clock::duration::zero(), watch.ElapsedStopTime());
}
Expand Down

0 comments on commit 0925141

Please sign in to comment.