Merge "The time#clock test has been a bit flaky."

This commit is contained in:
Treehugger Robot 2019-06-21 08:06:28 +00:00 committed by Gerrit Code Review
commit 05407d81f8
1 changed files with 2 additions and 2 deletions

View File

@ -748,11 +748,11 @@ TEST(time, clock_getres_unknown) {
}
TEST(time, clock) {
// clock(3) is hard to test, but a 1s sleep should cost less than 1ms.
// clock(3) is hard to test, but a 1s sleep should cost less than 5ms.
clock_t t0 = clock();
sleep(1);
clock_t t1 = clock();
ASSERT_LT(t1 - t0, CLOCKS_PER_SEC / 1000);
ASSERT_LT(t1 - t0, 5 * (CLOCKS_PER_SEC / 1000));
}
static pid_t GetInvalidPid() {