[Webkit-unassigned] [Bug 185385] REGRESSION: Layout Test performance-api/performance-observer-entry-sort.html is flaky

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 10 20:22:07 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=185385

--- Comment #2 from Ryosuke Niwa <rniwa at webkit.org> ---
There is a race condition in the test here.

We have the following code:

function wait() {
    let now = performance.now();
    while (now === performance.now())
        continue;
}
...
wait(); // Ensure mark2 !== mark3 startTime by making sure performance.now advances.
performance.mark("mark3");
performance.measure("measure3");
performance.measure("measure-matching-mark2-2", "mark2");

Here, the test expects the start time of "mark3" and "measure-matching-mark2-2" to be identical since we just aligned at 1ms granularity of performance.now().

If that were always true, then we would expect "mark3" to always appear after "measure-matching-mark2-2" because UserTiming::measure places a "measure" entry before a "mark" entry with the same start time.

However, this isn't always guaranteed. On a highly contentious computer, we might get pre-emptied right after enqueuing "mark3" but before enqueuing "measure-matching-mark2-2", thereby making "measure-matching-mark2-2"'s start time to be later than "mark3"'s start time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180511/e634d627/attachment.html>


More information about the webkit-unassigned mailing list