diff --git a/test/syscalls/linux/itimer.cc b/test/syscalls/linux/itimer.cc index 57ffd1595..51ce323b9 100644 --- a/test/syscalls/linux/itimer.cc +++ b/test/syscalls/linux/itimer.cc @@ -196,13 +196,18 @@ int TestSIGALRMToMainThread() { // ITIMER_REAL-generated SIGALRMs prefer to deliver to the thread group leader // (but don't guarantee it), so we expect to see most samples on the main // thread. + // + // The number of SIGALRMs delivered to a worker should not exceed 20% + // of the number of total signals expected (this is somewhat arbitrary). + const int worker_threshold = result.expected_total / 5; + // // Linux only guarantees timers will never expire before the requested time. // Thus, we only check the upper bound and also it at least have one sample. TEST_CHECK(result.main_thread_samples <= result.expected_total); TEST_CHECK(result.main_thread_samples > 0); for (int num : result.worker_samples) { - TEST_CHECK_MSG(num <= 50, "worker received too many samples"); + TEST_CHECK_MSG(num <= worker_threshold, "worker received too many samples"); } return 0;