ckerr

#54955: test: wait for service worker activation before stopping it

Merged
Created: Oct 14, 2026, 5:26:00 PM
Merged: Oct 15, 2026, 1:16:10 PM
6 comments
Target: main

Description of Change

Fixes intermittent failures in two ServiceWorkerMain specs:
startWorkerForScope() starts previously stopped worker
("expected undefined not to be undefined") and
ipc handle(channel) works after restarting worker
("Failed to start service worker.").

Both specs stopped the worker as soon as it reported running.
A newly registered worker is already running while its install event is in flight.
A stop at that point aborts the install, so Chromium marks the version redundant and deletes the new registration.
After that, the stopped event has no ServiceWorkerMain to return,
and startWorkerForScope() has no registration to start.
Delaying the install event in the fixture makes both failures reproduce every time.

The specs now wait in the page until the registration's worker is activated before stopping it.
If the worker becomes redundant instead, the wait fails immediately.
A stop after activation cannot fail the registration.
starts previously stopped worker also checks that the stopped and restarted worker is the original ServiceWorkerMain.
works after restarting worker checks that startWorkerForScope() restarted that same worker.

🤖 Generated with Claude Code

Checklist

Release Notes

Notes: none

Backports

42-x-y
Merged
PR Number
#55019
Merged At
Oct 15, 2026, 4:42:28 PM
Released In
v42.11.15
Release Date
Oct 15, 2026, 6:47:15 PM
43-x-y
Merged
PR Number
#55022
Merged At
Oct 15, 2026, 3:59:32 PM
Released In
v43.8.0
Release Date
Oct 15, 2026, 10:33:22 PM
44-x-y
Merged
PR Number
#55020
Merged At
Oct 15, 2026, 3:59:37 PM
Released In
v44.8.0
Release Date
Oct 15, 2026, 6:51:32 PM
45-x-y
Merged
PR Number
#55021
Merged At
Oct 15, 2026, 4:42:31 PM
Released In
v45.0.0-beta.5
Release Date
Oct 15, 2026, 10:41:45 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron