Bug 179342

Summary: REGRESSION (r224301?): LayoutTest http/tests/workers/service/registration-task-queue-scheduling-1.html is a flaky failure
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: New BugsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, cdumez, commit-queue, ews-watchlist, ggaren, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews101 for mac-sierra
none
Patch none

Description Ryan Haddad 2017-11-06 13:35:30 PST
LayoutTest http/tests/workers/service/registration-task-queue-scheduling-1.html is a flaky failure

https://build.webkit.org/results/Apple%20El%20Capitan%20Release%20WK2%20(Tests)/r224502%20(5779)/results.html

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fworkers%2Fservice%2Fregistration-task-queue-scheduling-1.html

--- /Volumes/Data/slave/elcapitan-release-tests-wk2/build/layout-test-results/http/tests/workers/service/registration-task-queue-scheduling-1-expected.txt
+++ /Volumes/Data/slave/elcapitan-release-tests-wk2/build/layout-test-results/http/tests/workers/service/registration-task-queue-scheduling-1-actual.txt
@@ -1,2 +1,3 @@
-CONSOLE MESSAGE: line 48: Original window resolved successfully (unexpected)
+ALERT: Popup window resolved successfully (unexpected)
+ALERT: Error in popup window
Comment 1 Ryan Haddad 2017-11-06 13:38:18 PST
This started being flaky recently. It could be related to https://trac.webkit.org/changeset/224301/webkit
Comment 2 Ryan Haddad 2017-11-08 17:47:44 PST
Marked test as flaky in https://trac.webkit.org/r224613
Comment 3 Radar WebKit Bug Importer 2017-11-10 14:26:13 PST
<rdar://problem/35478161>
Comment 4 Alexey Proskuryakov 2017-11-28 18:27:13 PST
I can reproduce this by repeating the test multiple times with an ASan build (which I just happened to have, a regular build may work too).

run-webkit-tests --no-retry --no-sample -v --repeat-each 10 http/tests/workers/service/registration-task-queue-scheduling-1.html
Comment 5 Chris Dumez 2018-01-09 15:27:08 PST
Created attachment 330852 [details]
Patch
Comment 6 youenn fablet 2018-01-09 16:07:25 PST
Comment on attachment 330852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330852&action=review

> LayoutTests/http/tests/workers/service/registration-task-queue-scheduling-1-expected.txt:1
> +ALERT: Done

Usually, we like to have PASS as expected.txt.
Can we modify LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1.js accordingly?

> LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1-second-window.html:7
> +	navigator.serviceWorker.register("http://127.0.0.1:8000/workers/service/empty-worker.js", { })

It is not clear to me why we open http://localhost:8000/workers/service/resources/registration-task-queue-scheduling-1-second-window.html but we fetch http://127.0.0.1:8000/workers/service/empty-worker.js instead of http://localhost:8000/workers/service/empty-worker.js.

If the host has no real importance, can we use something else than empty-worker.js, something like this-worker-is-no-there.js for instance?
Or are we testing cross origin loads.

> LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1.js:46
> +	navigator.serviceWorker.register("http://localhost:8000/workers/service/resources/empty-worker.js", { })

Ditto here.

> LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1.js:-55
> -		

Can we check the error type?
Comment 7 Chris Dumez 2018-01-09 18:50:26 PST
Comment on attachment 330852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330852&action=review

>> LayoutTests/http/tests/workers/service/registration-task-queue-scheduling-1-expected.txt:1
>> +ALERT: Done
> 
> Usually, we like to have PASS as expected.txt.
> Can we modify LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1.js accordingly?

Sure, this is how Brady wrote the test but I can change that.

>> LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1-second-window.html:7
>> +	navigator.serviceWorker.register("http://127.0.0.1:8000/workers/service/empty-worker.js", { })
> 
> It is not clear to me why we open http://localhost:8000/workers/service/resources/registration-task-queue-scheduling-1-second-window.html but we fetch http://127.0.0.1:8000/workers/service/empty-worker.js instead of http://localhost:8000/workers/service/empty-worker.js.
> 
> If the host has no real importance, can we use something else than empty-worker.js, something like this-worker-is-no-there.js for instance?
> Or are we testing cross origin loads.

We want the registration to fail since this is what the test expects. Registration fails if the origin of the script does not match the origin of the client, which is why I specifically chose those origins.

>> LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1.js:-55
>> -		
> 
> Can we check the error type?

Yes
Comment 8 Chris Dumez 2018-01-09 19:43:53 PST
Created attachment 330872 [details]
Patch
Comment 9 EWS Watchlist 2018-01-10 01:01:52 PST
Comment on attachment 330872 [details]
Patch

Attachment 330872 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/6016636

New failing tests:
webgl/1.0.2/conformance/uniforms/uniform-default-values.html
imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-v-framerate.html
Comment 10 EWS Watchlist 2018-01-10 01:01:53 PST
Created attachment 330883 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 11 youenn fablet 2018-01-10 01:57:27 PST
Comment on attachment 330872 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330872&action=review

> LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1-second-window.html:7
> +	navigator.serviceWorker.register("http://127.0.0.1:8000/workers/service/empty-worker.js", { })

http://127.0.0.1:8000/workers/service/empty-worker.js is probably returning a 404.
Since the test is about cross origin, we probably want to use "http://127.0.0.1:8000/workers/service/resources/empty-worker.js"
Comment 12 Chris Dumez 2018-01-10 09:19:55 PST
(In reply to youenn fablet from comment #11)
> Comment on attachment 330872 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=330872&action=review
> 
> > LayoutTests/http/tests/workers/service/resources/registration-task-queue-scheduling-1-second-window.html:7
> > +	navigator.serviceWorker.register("http://127.0.0.1:8000/workers/service/empty-worker.js", { })
> 
> http://127.0.0.1:8000/workers/service/empty-worker.js is probably returning
> a 404.
> Since the test is about cross origin, we probably want to use
> "http://127.0.0.1:8000/workers/service/resources/empty-worker.js"

Oh, that's a good point. Will fix before landing.
Comment 13 Chris Dumez 2018-01-10 09:21:28 PST
Created attachment 330919 [details]
Patch
Comment 14 WebKit Commit Bot 2018-01-10 10:20:34 PST
Comment on attachment 330919 [details]
Patch

Clearing flags on attachment: 330919

Committed r226722: <https://trac.webkit.org/changeset/226722>
Comment 15 WebKit Commit Bot 2018-01-10 10:20:37 PST
All reviewed patches have been landed.  Closing bug.