DescriptionFixed flaky clock_unittest by using relative comparison.
ClockTest.NtpTime was checking that the two methods for getting the
system time are returning a value that is within a fixed error margin
(100 ms) of each other. Unfortunately, even such a wide margin was
sometimes exceeded on heavily loaded machines
(https://build.chromium.org/p/client.webrtc/builders/Mac%20Asan/builds/9235/steps/system_wrappers_unittests/logs/stdio).
This CL changes the test to sandwich clock->CurrentNtp() between
clock->CurrentNtpTimeInMilliseconds(). This way the test will pass no
matter how much time elapses between the two method calls, as long as
the clock is monotonic.
Repeated test runs showed that there may be 1 ms worth of rounding error
between the two methods of getting time, so we have to allow that.
BUG=None.
Committed: https://crrev.com/de3f844a2099eaae32e61c87b509750c94215f59
Cr-Commit-Position: refs/heads/master@{#14520}
Patch Set 1 #
Messages
Total messages: 8 (3 generated)
|