Closed Bug 1262702 Opened 8 years ago Closed 8 years ago

Intermittent test_serviceworker_lifetime.html | Service worker was terminated, | Test timed out, etc.

Categories

(Core :: DOM: Notifications, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox48 --- unaffected
firefox49 --- fixed
firefox50 --- fixed
firefox51 --- fixed

People

(Reporter: philor, Assigned: bkelly)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Any ideas, Kit?
Flags: needinfo?(kcambridge)
Not yet. :-( Keeping ni? to follow up, but I won't have cycles to look into this for a while.
Any ideas Ben? This is really frequent on Beta too.
Flags: needinfo?(bkelly)
I'll look on Monday.  I'm on PTO tomorrow.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Flags: needinfo?(bkelly)
Comment on attachment 8786091 [details] [diff] [review]
Avoid racing with initial shutdown in test_service_worker_lifetime.html. r=kitcambridge

Try is green with ~30 pushes on linux64 pgo.  So I think this is good to go.

Kit, I believe the issue here is that the initial service worker instance spawned during the createIframe() call was sometimes shutting down right as the push event was being processed.  Normally the timing works our ok, but in pgo we start losing the race.

This patch avoids the problem by waiting to proceed until this initial service worker thread has positively been stopped.
Flags: needinfo?(kcambridge)
Attachment #8786091 - Flags: review?(kcambridge)
Comment on attachment 8786091 [details] [diff] [review]
Avoid racing with initial shutdown in test_service_worker_lifetime.html. r=kitcambridge

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

Thanks, Ben!
Attachment #8786091 - Flags: review?(kcambridge) → review+
Ben explained this to me a bit more on IRC. The explanation was very helpful, so capturing it here for posterity...

09:35 <bkelly> whats up?
09:36 <kitcambridge> bkelly: just trying to understand what's going on with that test. :-) so, createIframe spins up the service worker...
09:36 <kitcambridge> but it has nothing to do, so it shuts down
09:36 <bkelly> kitcambridge: right, because idle timer is set to zero
09:36 <kitcambridge> and that races with the setShutdownObserver(false)?
09:36 <bkelly> kitcambridge: but it still takes some time to shutdown
09:37 <bkelly> kitcambridge: and in non-pgo sometimes it shuts down after setShutdownObserver(false), but before we can fire the push event to trigger the waitUntil()
09:37 <bkelly> sorry in pgo
09:37 <kitcambridge> and in that case, we'll observe the earlier shutdown instead of the one caused by the push event
09:38 <bkelly> right
09:38 <kitcambridge> so your patch fixes that so it waits for the first shutdown
09:38 <kitcambridge> and after that, we attach another observer and fire the event
09:39 <bkelly> and that event uses a waitUntil() to keep it alive
09:39 <bkelly> so we have no shutdown race
Pushed by bkelly@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31b100c982b5
Avoid racing with initial shutdown in test_service_worker_lifetime.html. r=kitcambridge
Let me see if this works in FF49.
Comment on attachment 8786091 [details] [diff] [review]
Avoid racing with initial shutdown in test_service_worker_lifetime.html. r=kitcambridge

The patch applies cleanly to beta and runs locally.

Approval Request Comment
[Feature/regressing bug #]: Service workers
[User impact if declined]: Test intermittents annoying RyanVM on beta/aurora.
[Describe test coverage new/current, TreeHerder]: The patch modifies an existing mochitest.
[Risks and why]: Minimal.  Only modified a test.
[String/UUID change made/needed]: None
Attachment #8786091 - Flags: approval-mozilla-beta?
Attachment #8786091 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/31b100c982b5
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Attachment #8786091 - Flags: approval-mozilla-beta?
Attachment #8786091 - Flags: approval-mozilla-aurora?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: