mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-13 00:41:02 +00:00
util_test Clock.SleepNanoseconds: don’t set an upper bound for the
amount of time spent sleeping. Even with the slop, this wound up being flaky, specifically on virtual machines. And guess what our automated test infrastructure runs on? TEST=util_test Clock.SleepNanoseconds R=rsesek@chromium.org Review URL: https://codereview.chromium.org/640373003
This commit is contained in:
parent
7669b33010
commit
8f23d3e475
@ -61,12 +61,8 @@ void TestSleepNanoseconds(uint64_t nanoseconds) {
|
||||
// sleeping.
|
||||
EXPECT_GE(diff, nanoseconds);
|
||||
|
||||
// It’s difficult to set an upper bound for the time spent sleeping. Allow
|
||||
// sleeps twice as long as requested, or sleeps a millisecond longer than
|
||||
// requested, whichever is larger. This is quite a lot of slop, but the
|
||||
// alternative would be test flakiness.
|
||||
uint64_t slop = std::max(static_cast<uint64_t>(1E6), nanoseconds);
|
||||
EXPECT_LE(diff, nanoseconds + slop);
|
||||
// It’s difficult to set an upper bound for the time spent sleeping, and
|
||||
// attempting to do so results in a flaky test.
|
||||
}
|
||||
|
||||
TEST(Clock, SleepNanoseconds) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user