Skip to content

Commit

Permalink
Fix callback-idle-periods.html's flaky failure. (web-platform-tests#4…
Browse files Browse the repository at this point in the history
…1358)

The test was assuming that new deadline (now + timeRemaining) to strictly
monotonically advance in each idle callback. This may not be the case when
multiple idle callbacks are scheduled & ran within a single millisecond.
  • Loading branch information
rniwa authored Aug 8, 2023
1 parent 29bc632 commit 0f0227f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requestidlecallback/callback-idle-periods.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
var remaining = deadline.timeRemaining();
var new_deadline = now + remaining;
if (previous_deadline != undefined) {
assert_true(new_deadline > previous_deadline, "A requestIdleCallback scheduled during an idle period should be called back with a deadline greater than that in the current idle period.");
assert_true(new_deadline >= previous_deadline, "A requestIdleCallback scheduled during an idle period should be called back with a deadline greater than or equal to that in the current idle period.");
}

// Schedule a new requestIdleCallback.
Expand Down

0 comments on commit 0f0227f

Please sign in to comment.