Commit 5b205831 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

[LongTaskV2] Fix flakiness in longtask-v8compile test

The original test is flaky in both virtual test and nonvirtual test.

For the non-virtual test, it was expected to fail for one reason but it's
reasonable to fail for other reasons as well. We should include those failures.

For the virtual test, the test failed since long tasks could be present in a
slow environment. We fix it by ignoring those longtasks & attributions that are
not generated by us. Also, we allow waiting for multiple entry lists until we
find the interesting one.

Bug: 775626
Change-Id: Ief2a3bc4016dc3f808cb17be0122e35f75b58f9a
Reviewed-on: https://chromium-review.googlesource.com/891571
Commit-Queue: Liquan Gu <maxlg@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533016}
parent ef425646
...@@ -1684,6 +1684,9 @@ crbug.com/711529 http/tests/workers/shared-worker-performance-timeline.html [ Ti ...@@ -1684,6 +1684,9 @@ crbug.com/711529 http/tests/workers/shared-worker-performance-timeline.html [ Ti
# This test requires enabling the flag CustomUserTiming in a virtual test. # This test requires enabling the flag CustomUserTiming in a virtual test.
crbug.com/758385 http/tests/performance-timing/custom-user-timing/po-customusertiming-mark.html [ Skip ] crbug.com/758385 http/tests/performance-timing/custom-user-timing/po-customusertiming-mark.html [ Skip ]
# This test requires enabling the flag LongTaskV2 in a virtual test suite.
crbug.com/738493 http/tests/performance-timing/longtask-v2/longtask-v8compile.html [ Skip ]
# Expected failures during incremental implementation of mojo notification. # Expected failures during incremental implementation of mojo notification.
crbug.com/595685 virtual/mojo-notifications/http/tests/notifications/close-dedicated-worker.html [ Skip ] crbug.com/595685 virtual/mojo-notifications/http/tests/notifications/close-dedicated-worker.html [ Skip ]
crbug.com/595685 virtual/mojo-notifications/http/tests/notifications/close-dispatch-asynchronous.html [ Skip ] crbug.com/595685 virtual/mojo-notifications/http/tests/notifications/close-dispatch-asynchronous.html [ Skip ]
...@@ -3204,8 +3207,6 @@ crbug.com/774463 [ Win7 Debug ] fast/events/autoscroll-should-not-stop-on-keypre ...@@ -3204,8 +3207,6 @@ crbug.com/774463 [ Win7 Debug ] fast/events/autoscroll-should-not-stop-on-keypre
crbug.com/774463 [ Win7 Debug ] virtual/mouseevent_fractional/fast/events/autoscroll-should-not-stop-on-keypress.html [ Failure Pass ] crbug.com/774463 [ Win7 Debug ] virtual/mouseevent_fractional/fast/events/autoscroll-should-not-stop-on-keypress.html [ Failure Pass ]
crbug.com/774688 [ Mac ] fast/spatial-navigation/snav-container-white-space.html [ Pass Failure ] crbug.com/774688 [ Mac ] fast/spatial-navigation/snav-container-white-space.html [ Pass Failure ]
crbug.com/776201 [ Win7 Debug ] virtual/longtask-v2/http/tests/performance-timing/longtask-v2/longtask-v8compile.html [ Pass Failure ]
# Sheriff failures 2017-10-23 # Sheriff failures 2017-10-23
crbug.com/772411 http/tests/media/autoplay-crossorigin.html [ Timeout Failure Pass ] crbug.com/772411 http/tests/media/autoplay-crossorigin.html [ Timeout Failure Pass ]
crbug.com/777222 http/tests/devtools/change-iframe-src.js [ Pass Failure Timeout ] crbug.com/777222 http/tests/devtools/change-iframe-src.js [ Pass Failure Timeout ]
......
This is a testharness.js-based test.
FAIL Performance longtask entries with script-compile attribute are observable. assert_false: script-compile is not captured. expected false got true
Harness: the test ran to completion.
...@@ -10,12 +10,20 @@ ...@@ -10,12 +10,20 @@
<div id="log"></div> <div id="log"></div>
<script> <script>
async_test(function (t) { async_test(function (t) {
const scriptURL = 'resources/makelongtask.js';
const lineColumn = '(0, 0)';
const observer = new PerformanceObserver( const observer = new PerformanceObserver(
t.step_func(function (entryList) { t.step_func(function(entryList) {
const entries = entryList.getEntries(); const longtaskEntries = entryList.getEntries().filter((e) => {
assert_equals(entries.length, 1, return e.attribution.find((a) => {
'Exactly one entry is expected.'); return a.scriptURL.includes(scriptURL);
const longtask = entries[0]; });
});
if (longtaskEntries.length === 0) {
return;
}
assert_equals(longtaskEntries.length, 1);
const longtask = longtaskEntries[0];
assert_equals(longtask.entryType, 'longtask'); assert_equals(longtask.entryType, 'longtask');
assert_equals(longtask.name, 'self'); assert_equals(longtask.name, 'self');
assert_greater_than(longtask.duration, 50); assert_greater_than(longtask.duration, 50);
...@@ -23,17 +31,19 @@ ...@@ -23,17 +31,19 @@
const currentTime = performance.now(); const currentTime = performance.now();
assert_less_than_equal(longtask.startTime, currentTime); assert_less_than_equal(longtask.startTime, currentTime);
const it = longtask.attribution.find(function(it) { const compileAttribution = longtask.attribution.filter((it) => {
return it.name === 'script-compile'; return it.name === 'script-compile' &&
it.scriptURL.includes(scriptURL);
}); });
assert_false(!it, 'script-compile is not captured.'); assert_equals(compileAttribution.length, 1);
const it = compileAttribution[0];
assert_greater_than(it.startTime, 0); assert_greater_than(it.startTime, 0);
assert_equals(it.entryType, 'taskattribution'); assert_equals(it.entryType, 'taskattribution');
assert_equals(it.containerType, 'iframe'); assert_equals(it.containerType, 'iframe');
assert_equals(it.containerId, ''); assert_equals(it.containerId, '');
assert_equals(it.containerName, ''); assert_equals(it.containerName, '');
assert_equals(it.containerSrc, ''); assert_equals(it.containerSrc, '');
assert_true(it.scriptURL.includes('resources/makelongtask.js(0, 0)')); assert_true(it.scriptURL.includes(scriptURL + lineColumn));
observer.disconnect(); observer.disconnect();
t.done(); t.done();
}) })
......
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