Closed Bug 2094856 Opened 12 days ago Closed 9 days ago

[wpt-sync] Sync PR 65006 - Fix service worker state race in protocol-handler WPTs

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 65006 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/65006
Details from upstream follow.

David Bienvenu <davidbienvenu@chromium.org> wrote:

Fix service worker state race in protocol-handler WPTs

In external/wpt/html/webappapis/system-state-and-capabilities/
the-navigator-object/resources/handler-tools.js, runTest passes
reg.installing to wait_for_state() after
service_worker_unregister_and_register() resolves. If the service worker
has already transitioned from installing to waiting or active before the
registration promise resolves, reg.installing is null and
wait_for_state() throws an error. Fall back to reg.waiting || reg.active
so wait_for_state() receives a valid ServiceWorker object regardless of
how quickly installation progresses.

Flaky test history:
https://ci.chromium.org/ui/test/chromium/%3A%2F%2F%5C%3Achrome_wpt_tests%21webtest%3A%3Aexternal%2Fwpt%2Fhtml%2Fwebappapis%2Fsystem-state-and-capabilities%2Fthe-navigator-object%23protocol-handler-path.https.html?q=VHASH%3A346bc8eacb050998

Bug: 371061343
Change-Id: Iaefcd1c90add026edcbc6f8c5b3889a3a9e0d81a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8772000
Commit-Queue: David Bienvenu \<davidbienvenu@chromium.org>
Reviewed-by: Jonathan Lee \<jonathanjlee@google.com>
Cr-Commit-Position: refs/heads/main@{#1740840}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 5 tests and 1 subtests

Status Summary

Firefox

ERROR : 5
NOTRUN: 5

Chrome

OK : 5
PASS : 5

Safari

ERROR : 5
NOTRUN: 5

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/753ba86904b2 https://hg.mozilla.org/integration/autoland/rev/168a641e83be [wpt PR 65006] - Fix service worker state race in protocol-handler WPTs, a=testonly
Status: NEW → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.