Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Issue 2393063002: Fixed flaky clock_unittest by using relative comparison. (Closed)

Created:
4 years, 2 months ago by skvlad
Modified:
4 years, 2 months ago
CC:
webrtc-reviews_webrtc.org, zhengzhonghou_agora.io, tterriberry_mozilla.com, fengyue_agora.io, peah-webrtc, mflodman
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fixed 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -4 lines) Patch
M webrtc/system_wrappers/source/clock_unittest.cc View 1 chunk +12 lines, -4 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
skvlad
PTAL. This is a fix for a flaky test: https://build.chromium.org/p/client.webrtc/builders/Mac%20Asan/builds/9235/steps/system_wrappers_unittests/logs/stdio
4 years, 2 months ago (2016-10-04 23:36:09 UTC) #2
henrika_webrtc
LGTM
4 years, 2 months ago (2016-10-05 08:22:19 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2393063002/1
4 years, 2 months ago (2016-10-05 08:53:48 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-10-05 08:55:06 UTC) #6
commit-bot: I haz the power
4 years, 2 months ago (2016-10-05 08:55:17 UTC) #8
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/de3f844a2099eaae32e61c87b509750c94215f59
Cr-Commit-Position: refs/heads/master@{#14520}

Powered by Google App Engine
This is Rietveld 408576698