Closed Bug 1364277 Opened 7 years ago Closed 7 years ago

dom/workers/tests/serviceworkers/test_controller.html races service worker state

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: bkelly, Assigned: bkelly)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

The test in:

  dom/workers/tests/serviceworkers/test_controller.html

Doesn't wait for the service worker registration to activate at all.  It has been relying on an empty service worker script just being really fast.

My patches in bug 1293277 trigger this more frequently, so I need to fix it.
Similar to bug 1364276, this is another test where we just don't wait for the service worker activate.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=34a669b02d57fa679d06976348c78dea48566e36
Attachment #8867019 - Flags: review?(bugmail)
Attachment #8867019 - Flags: review?(bugmail)
It turned out there were more issues like this in dom/workers/test/serviceworkers.  So I added a waitForState() helper and tried to use it everywhere it seemed like it could help.

This directory has a lot of tests that use a pattern where an iframe is created and the ready promise in the iframe signals activation.  I tried not to duplicate with this technique, but I think in some cases I did.  This should not cause a problem, though.  In general I think waiting for a consistent state would be more predictable.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=df5a83b973e01c07e1bc4ea4afd2878e05b57454
Attachment #8867019 - Attachment is obsolete: true
Attachment #8867427 - Flags: review?(bugmail)
Comment on attachment 8867427 [details] [diff] [review]
Wait for service workers to activate more in dom/workers/test/serviceworkers. r=asuth

Sorry for the flag spam.  I missed at least one more test here.
Attachment #8867427 - Flags: review?(bugmail)
Comment on attachment 8867429 [details] [diff] [review]
Wait for service workers to activate more in dom/workers/test/serviceworkers. r=asuth

Ok, both my client patches and the try server are happy with this now.
Attachment #8867429 - Flags: review?(bugmail)
Comment on attachment 8867429 [details] [diff] [review]
Wait for service workers to activate more in dom/workers/test/serviceworkers. r=asuth

Review of attachment 8867429 [details] [diff] [review]:
-----------------------------------------------------------------

Lots of good cleanup in here!  (And it's a little amusing that the XSLT test had the "best" wait-for-activation logic, it just hadn't been factored out into a helper.)
Attachment #8867429 - Flags: review?(bugmail) → review+
Pushed by bkelly@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b38af5ceaae5
Wait for service workers to activate more in dom/workers/test/serviceworkers. r=asuth
https://hg.mozilla.org/mozilla-central/rev/b38af5ceaae5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: