RESOLVED FIXED 189560
Add stability to tests for web API statistics
https://bugs.webkit.org/show_bug.cgi?id=189560
Summary Add stability to tests for web API statistics
Woodrow Wang
Reported 2018-09-12 15:01:02 PDT
This patch is meant to increase the stability of tests for the web API statistics. The original tests had unnecessary dependencies we can remove in order to improve stability.
Attachments
Patch (11.77 KB, patch)
2018-09-12 15:07 PDT, Woodrow Wang
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.81 MB, application/zip)
2018-09-12 19:31 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.41 MB, application/zip)
2018-09-12 21:05 PDT, EWS Watchlist
no flags
Patch (13.49 KB, patch)
2018-09-13 11:23 PDT, Woodrow Wang
no flags
Patch (13.76 KB, patch)
2018-09-13 17:16 PDT, Woodrow Wang
no flags
Patch (13.74 KB, patch)
2018-09-14 11:05 PDT, Woodrow Wang
no flags
Patch (14.76 KB, patch)
2018-09-14 11:58 PDT, Woodrow Wang
cdumez: review+
cdumez: commit-queue-
Patch (14.76 KB, patch)
2018-09-14 13:38 PDT, Woodrow Wang
no flags
Patch (14.76 KB, patch)
2018-09-14 14:25 PDT, Woodrow Wang
no flags
Radar WebKit Bug Importer
Comment 1 2018-09-12 15:02:33 PDT
Woodrow Wang
Comment 2 2018-09-12 15:07:28 PDT
EWS Watchlist
Comment 3 2018-09-12 19:31:52 PDT
Comment on attachment 349586 [details] Patch Attachment 349586 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/9197802 New failing tests: http/tests/webAPIStatistics/font-load-data-collection.html http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
EWS Watchlist
Comment 4 2018-09-12 19:31:54 PDT
Created attachment 349615 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
EWS Watchlist
Comment 5 2018-09-12 21:05:02 PDT
Comment on attachment 349586 [details] Patch Attachment 349586 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/9198691 New failing tests: http/tests/webAPIStatistics/font-load-data-collection.html http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html fast/animation/css-animation-resuming-when-visible-with-style-change2.html http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
EWS Watchlist
Comment 6 2018-09-12 21:05:04 PDT
Created attachment 349622 [details] Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Chris Dumez
Comment 7 2018-09-13 08:48:41 PDT
Comment on attachment 349586 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349586&action=review > LayoutTests/http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html:16 > testRunner.dumpResourceLoadStatistics(); The testRunner.dump*() calls should likely happen much earlier, before your hostUnderTest initialization above.
Woodrow Wang
Comment 8 2018-09-13 11:23:26 PDT
Chris Dumez
Comment 9 2018-09-13 13:39:44 PDT
Comment on attachment 349686 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349686&action=review > LayoutTests/ChangeLog:8 > + Do you have an explanation why not using js-test would improve stability? > LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html:16 > testRunner.notifyDone(); Note that the tests should have been using finishJSTest() instead of testRunner.notifyDone() when using js-test.js.
Woodrow Wang
Comment 10 2018-09-13 15:19:45 PDT
(In reply to Chris Dumez from comment #9) > Comment on attachment 349686 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349686&action=review > > > LayoutTests/ChangeLog:8 > > + > > Do you have an explanation why not using js-test would improve stability? Using js-test added some data to the font loading collection, which made the tests dependent on js-test.js. Thus, if any changes were made to js-test.js the tests for web API statistics would fail. There seems to be some flakiness in clearing the resource load statistics map that are occurring seen here https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2FwebAPIStatistics%2Fnavigator-functions-accessed-data-collection.html%20http%2Ftests%2FwebAPIStatistics%2Fcanvas-read-and-write-data-collection.html%20http%2Ftests%2FwebAPIStatistics%2Ffont-load-data-collection.html%20http%2Ftests%2FwebAPIStatistics%2Fscreen-functions-accessed-data-collection.html I am currently trying to determine why the flakiness exists, but have been unable to reproduce any similar failures locally. > > > LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html:16 > > testRunner.notifyDone(); > > Note that the tests should have been using finishJSTest() instead of > testRunner.notifyDone() when using js-test.js.
Woodrow Wang
Comment 11 2018-09-13 17:16:27 PDT
Woodrow Wang
Comment 12 2018-09-13 17:17:33 PDT
We can significantly improve the amount of time each test takes by overriding the timer initially relied upon in the ResourceLoadObserver with an existing testRunner function.
Per Arne Vollan
Comment 13 2018-09-14 09:40:28 PDT
Comment on attachment 349717 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349717&action=review > LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html:-18 > - testRunner.statisticsResetToConsistentState(function() { > - testRunner.notifyDone(); > - }); There is no need to call this function anymore?
Woodrow Wang
Comment 14 2018-09-14 11:05:59 PDT
Chris Dumez
Comment 15 2018-09-14 11:27:32 PDT
Comment on attachment 349781 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349781&action=review > LayoutTests/ChangeLog:8 > + Please explain *In the changelog* why this helps with stability. > LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html:12 > + testRunner.dumpAsText(); I think these testRunner calls should be with the one to testRunner.waitUntilDone(); at the end of the test. Sorry, I know I recommended this locally but I did not see at the time that there was already a section taking care of testRunner calls. Same comment in other tests. > LayoutTests/http/tests/webAPIStatistics/font-load-data-collection.html:39 > + }, 100); Why 100? Either 0 works consistently or this will introduce flakiness.
Woodrow Wang
Comment 16 2018-09-14 11:39:09 PDT
(In reply to Chris Dumez from comment #15) > Comment on attachment 349781 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349781&action=review > > > LayoutTests/ChangeLog:8 > > + > > Please explain *In the changelog* why this helps with stability. Will do. > > > LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html:12 > > + testRunner.dumpAsText(); > > I think these testRunner calls should be with the one to > testRunner.waitUntilDone(); at the end of the test. > Sorry, I know I recommended this locally but I did not see at the time that > there was already a section taking care of testRunner calls. > > Same comment in other tests. I'll move it accordingly! > > > LayoutTests/http/tests/webAPIStatistics/font-load-data-collection.html:39 > > + }, 100); > > Why 100? Either 0 works consistently or this will introduce flakiness. 0 does work consistently locally, so I will change it to 0 and monitor the bots to ensure there's no unforeseen flakiness.
Woodrow Wang
Comment 17 2018-09-14 11:58:42 PDT
Chris Dumez
Comment 18 2018-09-14 12:01:44 PDT
Comment on attachment 349787 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349787&action=review r=me > LayoutTests/http/tests/webAPIStatistics/font-load-data-collection.html:34 > + // Adds a timeout to allow font loads to be recorded Style: period needed at the end of the comment.
Woodrow Wang
Comment 19 2018-09-14 13:38:41 PDT
Woodrow Wang
Comment 20 2018-09-14 14:25:24 PDT
(In reply to Woodrow Wang from comment #19) > Created attachment 349796 [details] > Patch Made a mistake rebasing with style fix, so I am reuploading the patch.
Woodrow Wang
Comment 21 2018-09-14 14:25:51 PDT
WebKit Commit Bot
Comment 22 2018-09-14 16:15:37 PDT
Comment on attachment 349804 [details] Patch Clearing flags on attachment: 349804 Committed r236021: <https://trac.webkit.org/changeset/236021>
WebKit Commit Bot
Comment 23 2018-09-14 16:15:39 PDT
All reviewed patches have been landed. Closing bug.
Truitt Savell
Comment 24 2018-09-17 12:48:58 PDT
This test: http/tests/webAPIStatistics/font-load-data-collection.html is still flakey after https://trac.webkit.org/changeset/236021/webkit I do want to note that the test is now passing faster. before it took 5 seconds now it passes or fails in under 1 second. This also seems to be the only test still failing from the tests edited in this patch. History: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2FwebAPIStatistics%2Ffont-load-data-collection.html Diff: https://build.webkit.org/results/Apple%20High%20Sierra%20Release%20WK2%20(Tests)/r236073%20(6775)/http/tests/webAPIStatistics/font-load-data-collection-pretty-diff.html
Woodrow Wang
Comment 25 2018-09-17 13:54:08 PDT
(In reply to Truitt Savell from comment #24) > This test: http/tests/webAPIStatistics/font-load-data-collection.html > > is still flakey after https://trac.webkit.org/changeset/236021/webkit > > I do want to note that the test is now passing faster. before it took 5 > seconds now it passes or fails in under 1 second. This also seems to be the > only test still failing from the tests edited in this patch. This was an expected enhancement by this patch :) > > History: > https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard. > html#showAllRuns=true&tests=http%2Ftests%2FwebAPIStatistics%2Ffont-load-data- > collection.html > > Diff: > https://build.webkit.org/results/ > Apple%20High%20Sierra%20Release%20WK2%20(Tests)/r236073%20(6775)/http/tests/ > webAPIStatistics/font-load-data-collection-pretty-diff.html https://bugs.webkit.org/show_bug.cgi?id=189632 is a speculative fix for the flakiness of the font-load-data-collection.html test.
Ryan Haddad
Comment 26 2018-09-19 10:03:30 PDT
(In reply to Woodrow Wang from comment #25) > (In reply to Truitt Savell from comment #24) > https://bugs.webkit.org/show_bug.cgi?id=189632 is a speculative fix for the > flakiness of the font-load-data-collection.html test. http/tests/webAPIStatistics/font-load-data-collection.html continues to be extremely flaky on the bots after that fix.
Woodrow Wang
Comment 27 2018-09-19 11:07:54 PDT
(In reply to Ryan Haddad from comment #26) > (In reply to Woodrow Wang from comment #25) > > (In reply to Truitt Savell from comment #24) > > https://bugs.webkit.org/show_bug.cgi?id=189632 is a speculative fix for the > > flakiness of the font-load-data-collection.html test. > > http/tests/webAPIStatistics/font-load-data-collection.html continues to be > extremely flaky on the bots after that fix. I'm actively investigating the flakiness and am working on https://bugs.webkit.org/show_bug.cgi?id=189684 as another speculative fix. I am not able to reproduce the flakiness locally as of now, so if this speculative fix does not work, I will mark the test as flaky.
Note You need to log in before you can comment on or make changes to this bug.