summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorNeel Natu <neelnatu@google.com>2019-06-20 15:57:11 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-20 15:58:18 -0700
commit3c7448ab6f178cfc171545d15ae039f318e38225 (patch)
tree856b82fb282b16b23af56d3c33d893986ba8b53b /test
parent7db8685100bc5f69ec42e5498781301ee835667c (diff)
Deflake TestSIGALRMToMainThread.
Bump up the threshold on number of SIGALRMs received by worker threads from 50 to 200. Even with the new threshold we still expect that the majority of SIGALRMs are received by the thread group leader. PiperOrigin-RevId: 254289787
Diffstat (limited to 'test')
-rw-r--r--test/syscalls/linux/itimer.cc7
1 files changed, 6 insertions, 1 deletions
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
@@ -197,12 +197,17 @@ int TestSIGALRMToMainThread() {
// (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;