Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/gtest_wakeup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ TEST(WakeUp, BasicTest)

using namespace std::chrono;

auto t1 = system_clock::now();
auto t1 = steady_clock::now();
tree.tickOnce();
tree.sleep(milliseconds(200));
auto t2 = system_clock::now();
auto t2 = steady_clock::now();

auto dT = duration_cast<milliseconds>(t2 - t1).count();
std::cout << "Woke up after msec: " << dT << std::endl;

ASSERT_LT(dT, 25);
// steady_clock is monotonic and immune to NTP/DST jumps.
// 100 ms gives headroom for scheduler jitter on loaded CI runners;
// the wake-up should fire well under that threshold.
ASSERT_LT(dT, 100);
}
Loading