diff --git a/tests/gtest_wakeup.cpp b/tests/gtest_wakeup.cpp index 0da9eb8bc..cca75f2fa 100644 --- a/tests/gtest_wakeup.cpp +++ b/tests/gtest_wakeup.cpp @@ -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(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); }