RESOLVED FIXED 158019
Fix ResourceTiming XHR flakiness
https://bugs.webkit.org/show_bug.cgi?id=158019
Summary Fix ResourceTiming XHR flakiness
Yoav Weiss
Reported 2016-05-24 03:22:16 PDT
Fix ResourceTiming XHR tests flakiness
Attachments
Patch (7.99 KB, patch)
2016-05-24 03:27 PDT, Yoav Weiss
no flags
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (1.05 MB, application/zip)
2016-05-24 03:51 PDT, Build Bot
no flags
Archive of layout-test-results from ews101 for mac-yosemite (998.80 KB, application/zip)
2016-05-24 04:13 PDT, Build Bot
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (671.63 KB, application/zip)
2016-05-24 04:24 PDT, Build Bot
no flags
Archive of layout-test-results from ews117 for mac-yosemite (1.42 MB, application/zip)
2016-05-24 04:25 PDT, Build Bot
no flags
Patch (13.47 KB, patch)
2016-05-24 04:40 PDT, Yoav Weiss
no flags
Patch (13.24 KB, patch)
2016-05-24 09:57 PDT, Yoav Weiss
no flags
Patch (15.91 KB, patch)
2016-05-24 14:38 PDT, Yoav Weiss
no flags
Patch (7.88 KB, patch)
2016-05-25 14:39 PDT, Yoav Weiss
no flags
Yoav Weiss
Comment 1 2016-05-24 03:27:53 PDT
Yoav Weiss
Comment 2 2016-05-24 03:40:15 PDT
This should fix the test flakiness observed in https://bugs.webkit.org/show_bug.cgi?id=157816 It also removes the XHR-specific treatment that I added in https://bugs.webkit.org/show_bug.cgi?id=157669 as it is not required. It seems like the ResourceTiming entries are added in CachedResourceLoader::loadDone only after the onload event for the XHR is running. I've opened a related spec issue to see what the correct behavior here should be: https://github.com/w3c/resource-timing/issues/55
Build Bot
Comment 3 2016-05-24 03:51:55 PDT
Comment on attachment 279638 [details] Patch Attachment 279638 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/1373989 New failing tests: http/tests/performance/performance-resource-timing-xhr-single-entry.html
Build Bot
Comment 4 2016-05-24 03:51:59 PDT
Created attachment 279640 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 5 2016-05-24 04:13:47 PDT
Comment on attachment 279638 [details] Patch Attachment 279638 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/1374049 New failing tests: http/tests/performance/performance-resource-timing-xhr-single-entry.html
Build Bot
Comment 6 2016-05-24 04:13:52 PDT
Created attachment 279641 [details] Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 7 2016-05-24 04:24:07 PDT
Comment on attachment 279638 [details] Patch Attachment 279638 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/1374057 New failing tests: http/tests/performance/performance-resource-timing-xhr-single-entry.html
Build Bot
Comment 8 2016-05-24 04:24:12 PDT
Created attachment 279642 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.4
Build Bot
Comment 9 2016-05-24 04:25:14 PDT
Comment on attachment 279638 [details] Patch Attachment 279638 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/1374054 New failing tests: http/tests/performance/performance-resource-timing-xhr-single-entry.html
Build Bot
Comment 10 2016-05-24 04:25:19 PDT
Created attachment 279643 [details] Archive of layout-test-results from ews117 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-yosemite Platform: Mac OS X 10.10.5
Yoav Weiss
Comment 11 2016-05-24 04:40:03 PDT
Alexey Proskuryakov
Comment 12 2016-05-24 08:27:52 PDT
Comment on attachment 279645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=279645&action=review > LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html:35 > + setTimeout(runTest, 10); A timeout of 10 ms is never right in regression tests. A process can be easily suspended for much longer. It's especially expected on GuardMalloc and ASan tests, but even release build tests have a lot of competition for resources.
Yoav Weiss
Comment 13 2016-05-24 08:42:42 PDT
(In reply to comment #12) > Comment on attachment 279645 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=279645&action=review > > > LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html:35 > > + setTimeout(runTest, 10); > > A timeout of 10 ms is never right in regression tests. A process can be > easily suspended for much longer. It's especially expected on GuardMalloc > and ASan tests, but even release build tests have a lot of competition for > resources. Any timeout would do here, it's just that I need for the test to run after the XHR's load event is over. So if the process will get suspended for a longer period, that's not an issue as long as the test's timeout is not exceeded. Let me know if a different timeout value (or a different method to run the test after the onload is over) is preferred.
Alex Christensen
Comment 14 2016-05-24 08:50:39 PDT
Comment on attachment 279645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=279645&action=review Would it work with a timeout of 0? I think a better approach would be to create the xhr after you're done with the first runTest call to make sure it will never start before the first one. > LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry.html:35 > + setTimeout(runTest, 10); Why do you call runTest twice but only expect it to be run once?
Yoav Weiss
Comment 15 2016-05-24 09:01:52 PDT
(In reply to comment #14) > Comment on attachment 279645 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=279645&action=review > > Would it work with a timeout of 0? I believe it would. > I think a better approach would be to > create the xhr after you're done with the first runTest call to make sure it > will never start before the first one. > > > LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry.html:35 > > + setTimeout(runTest, 10); > > Why do you call runTest twice but only expect it to be run once? I copied this mechanism from another test where the XHR call is racing with window's onload event (as XHR is not blocking onload). So, I wanted the test to run once at the later one of those events, but not inside XHR's onload event, as the entries are not yet added at this point. It's true that for the xhr-single-entry I could just eliminate the window.onload part altogether.
Yoav Weiss
Comment 16 2016-05-24 09:57:30 PDT
Yoav Weiss
Comment 17 2016-05-24 14:38:52 PDT
Yoav Weiss
Comment 18 2016-05-24 22:44:52 PDT
Latest patch adds back the tests that got rolled out in http://trac.webkit.org/changeset/201343, as this fixes their flakiness. Let me know if it's preferred that I'll split this patch into two separate ones (as it treats two different flakiness issues).
Alex Christensen
Comment 19 2016-05-25 14:14:51 PDT
Could you describe the difference in your latest patch?
Yoav Weiss
Comment 20 2016-05-25 14:39:48 PDT
Yoav Weiss
Comment 21 2016-05-25 14:41:42 PDT
I removed the parts related to initiator tests flakiness, and only left in the parts related to XHR flakiness, in order to make the patch clearer. I'll submit the initiator parts as a separate patch.
Yoav Weiss
Comment 22 2016-05-25 15:00:20 PDT
WebKit Commit Bot
Comment 23 2016-05-25 22:32:49 PDT
Comment on attachment 279818 [details] Patch Clearing flags on attachment: 279818 Committed r201414: <http://trac.webkit.org/changeset/201414>
WebKit Commit Bot
Comment 24 2016-05-25 22:32:55 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.