Commit 45bcab0c authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

Increase timer tolerance for web test

Looking at the flakiness dashboard, all of the failures are due to
timers running within 200ms of the expected time. The test is intended
to detect the difference between timers running at 100ms intervals and
at 1000ms intervals, so the greater tolerance still provides adequate
coverage.

BUG=971590
R=alexclarke@chromium.org

Change-Id: I7b9ea31ad6dce2ba3c2cbfb9f3afa0eb8ea29ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758662Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688509}
parent d8b65ddc
...@@ -6290,7 +6290,6 @@ crbug.com/971319 [ Mac ] media/audio-garbage-collect.html [ Pass Timeout ] ...@@ -6290,7 +6290,6 @@ crbug.com/971319 [ Mac ] media/audio-garbage-collect.html [ Pass Timeout ]
crbug.com/971319 [ Mac ] virtual/audio-service/media/audio-garbage-collect.html [ Pass Timeout ] crbug.com/971319 [ Mac ] virtual/audio-service/media/audio-garbage-collect.html [ Pass Timeout ]
# Sheriff 2019-06-06 # Sheriff 2019-06-06
crbug.com/971590 [ Mac ] fast/dom/timer-throttling-hidden-page.html [ Pass Failure ]
crbug.com/971612 fast/canvas/OffscreenCanvas-MessageChannel-transfer.html [ Pass Failure ] crbug.com/971612 fast/canvas/OffscreenCanvas-MessageChannel-transfer.html [ Pass Failure ]
# Sheriff 2019-06-13 # Sheriff 2019-06-13
......
...@@ -2,12 +2,12 @@ Bug 98474: Throttle DOM timers on hidden pages. ...@@ -2,12 +2,12 @@ Bug 98474: Throttle DOM timers on hidden pages.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS timerIntervalWhilePageVisible is within 100 of 100 PASS timerIntervalWhilePageVisible is within 200 of 100
PASS firstTimerIntervalWhilePageNotVisible is >= 0 PASS firstTimerIntervalWhilePageNotVisible is >= 0
PASS firstTimerIntervalWhilePageNotVisible <= 1200 is true PASS firstTimerIntervalWhilePageNotVisible <= 1300 is true
PASS timerIntervalWhilePageNotVisible is within 100 of 1000 PASS timerIntervalWhilePageNotVisible is within 200 of 1000
PASS timerIntervalWhilePageVisible is within 100 of 100 PASS timerIntervalWhilePageVisible is within 200 of 100
PASS timerIntervalWhilePageVisible is within 100 of 100 PASS timerIntervalWhilePageVisible is within 200 of 100
PASS successfullyParsed is true PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
var firstTimerWhileNotVisible = true; var firstTimerWhileNotVisible = true;
var isPageVisible = true; var isPageVisible = true;
var timeoutInterval = 100; var timeoutInterval = 100;
var tolerance = 100; // Some of our testing hardware runs very slowly, so we need a generous
// tolerance value.
var tolerance = 200;
var timerAlignmentInterval = 1000; var timerAlignmentInterval = 1000;
function testTimer() function testTimer()
...@@ -19,7 +21,9 @@ ...@@ -19,7 +21,9 @@
if (!isPageVisible) { if (!isPageVisible) {
if (firstTimerWhileNotVisible) { if (firstTimerWhileNotVisible) {
firstTimerIntervalWhilePageNotVisible = time - previousTime; firstTimerIntervalWhilePageNotVisible = time - previousTime;
var minValue = timeoutInterval - tolerance; // Even if (tolerance > timeoutInterval), we should never
// get a negative elapsed time, so clamp minValue to zero.
var minValue = Math.max(0, timeoutInterval - tolerance);
shouldBeGreaterThanOrEqual("firstTimerIntervalWhilePageNotVisible", minValue.toString()); shouldBeGreaterThanOrEqual("firstTimerIntervalWhilePageNotVisible", minValue.toString());
var maxValue = timeoutInterval + timerAlignmentInterval + tolerance; var maxValue = timeoutInterval + timerAlignmentInterval + tolerance;
shouldBeTrue("firstTimerIntervalWhilePageNotVisible <= " + maxValue); shouldBeTrue("firstTimerIntervalWhilePageNotVisible <= " + maxValue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment