Skip to content

Commit 6e0efc3

Browse files
test(timer): enable CreateTimer count assertion on macOS
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 32702e4 commit 6e0efc3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/test/timer/timer_test.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ TEST(Timer, CreateTimer) {
5757
// 1e7 = 10ms, 100ms = 1e8
5858
// 1s = 1e9
5959
DEBUG("timer event count: " << count);
60-
#ifdef __linux__
60+
#if defined(__linux__) || defined(__APPLE__)
6161
// tight 100us / 10ms window is sensitive to host load; under CI's
62-
// valgrind run it can drop to ~70. Use a loose envelope that still
63-
// catches gross regressions (timer not firing, or firing wildly).
62+
// valgrind run it can drop to ~70, and macOS GCD has its own jitter.
63+
// Use a loose envelope that still catches gross regressions (timer not
64+
// firing, or firing wildly).
6465
MUST_TRUE(count >= 20 && count <= 200,
6566
"timer event count wrong " + to_string(count));
6667
#endif

0 commit comments

Comments
 (0)