Closed Bug 1874782 Opened 2 years ago Closed 1 year ago

Stop using randomized test worker URL

Categories

(Core :: DOM: Push Subscriptions, task)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

Details

Attachments

(1 file)

But await SWR.unregister() should make sure it waits until the actual unregistration, not sure how there can still be a registration after unregister()? I took a look how the function works and to me it seems the promise is properly only resolved during the processing of the unregistration queue, so I'm confused.

Andrew, any idea?

Flags: needinfo?(bugmail)

From the log in the comment I understand the issue to be that the SimpleTest infrastructure is seeing that we still have registered ServiceWorkers.

I see that this seems to be the first test after restarting Firefox, and that the last test in the preceding run also seems to be a push test dom/push/test/test_unregister.html.

The simplest explanation is that we are reusing the profile and the previous run shut down before having flushed serviceworker.txt to disk. (That said, we have a shutdown blocker that should block shutdown until we have flushed the data (calls-between diagram).) The next alternative is that a functional event or soft update check has gone and begun to reinstall the ServiceWorker. We do have delays in some update logic that use fairly simple runnables, so it wouldn't be shocking to find that these are responsible. Unfortunately, it seems like this all only happens on windows, so it's not easy to just get a pernosco trace.

The push tests seems to use Math.random() in the cache-busting idiom that likely was advisable back in the days of ServiceWorker resurrection, but is now unnecessary because, as you found, unregister() should be reliable. I would suggest changing the unregister cache-busting to be something deterministic like return "worker.js?test_unregister.html"; and similarly in test_permission_granted too. (Well, ideally, in all cases.) This should help make it clear what the source of the bad SW is.

Flags: needinfo?(bugmail)

Thanks! (Yay that the resurrection is dead and makes things simple 🎉)

Actually we can open another bug for a real fix.

Keywords: leave-open
Summary: Wait more for SW to be actually unregistered in push test → Stop using randomized test worker URL
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/89e19e5ed13b Stop using Math.random() for test worker URL r=asuth
Regressions: 1900917
Regressions: 1900918
Regressions: 1900919
Regressions: 1900920
Regressions: 1900923
Regressions: 1900924
Regressions: 1900925
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
No longer regressions: 1900920
No longer regressions: 1900925
No longer regressions: 1900924
No longer regressions: 1900923
No longer regressions: 1900919
No longer regressions: 1900918
No longer regressions: 1900917
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: