Closed Bug 2088856 Opened 16 days ago Closed 13 days ago

browser_ext_slow_script.js fails with "stopButton is null" and then hangs until the task's max run time

Categories

(WebExtensions :: Untriaged, defect)

defect

Tracking

(firefox-esr153 unaffected, firefox159 unaffected, firefox160 unaffected, firefox161 fixed, firefox162 fixed)

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox159 --- unaffected
firefox160 --- unaffected
firefox161 --- fixed
firefox162 --- fixed

People

(Reporter: jstutte, Assigned: flod)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 external files)

Since 2026-10-29, browser/components/extensions/test/browser/browser_ext_slow_script.js fails on macOS aarch64 with:

TEST-FAIL | browser_ext_slow_script.js | test_slow_content_script - Uncaught exception in test - TypeError: can't access property "click", stopButton is null

The extension is then unloaded while its content script keeps busy-waiting, ProcessHangMonitor.sys.mjs logs NS_ERROR_ILLEGAL_VALUE from nsIAddonPolicyService.getExtensionName every few seconds, and the job runs until the task is aborted for exceeding its max run time (about 90 minutes later). These jobs get classified as the max-run-time meta bug 1809667, which hides them: of the 125 macosx1500-aarch64 browser-chrome jobs classified there between 2026-10-05 and 2026-11-04, 117 stopped in this test, all from 2026-10-29 on (about 17 a day, on autoland, mozilla-central and try).

This started with bug 2086504, which moved the hang notification's strings to Fluent. The Stop button used to get label synchronously; it now gets "l10n-id": "process-hang-stop-button", so its label is filled in asynchronously, while the test still looks it up right away with querySelector("[label='Stop']").

Notification buttons get their data-l10n-id attribute synchronously (document.l10n.setAttributes in notificationbox.js), so looking the button up with [data-l10n-id='process-hang-stop-button'] should fix the test. Separately, it might be worth making the hang notification cope with the extension being gone, so that a failing test does not turn into a 90 minute hang.

Set release status flags based on info from the regressing bug 2086504

:flod, since you are the author of the regressor, bug 2086504, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(francesco.lodolo)

Will look into it today.

Since 2026-10-29, browser/components/extensions/test/browser/browser_ext_slow_script.js fails on macOS aarch64 with:

Can you add more on how you're testing this? I've tested the patch locally multiple times on the same platform, but didn't see a failure.

Flags: needinfo?(francesco.lodolo) → needinfo?(jstutte)

OK, apparently the failure depends on the machine, and how quickly it can get the Fluent translation.

Flags: needinfo?(jstutte)

The Stop button label is now set asynchronously by Fluent. If the test fails,
stop the hung script during cleanup, and let the hang notification fall back
to the add-on ID once the extension has been unloaded.

Assignee: nobody → francesco.lodolo
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 2086504

Pushed by flodolo@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5ebc7d35f7aa https://hg.mozilla.org/integration/autoland/rev/bde9ac7bdb88 Fix browser_ext_slow_script.js looking up the Stop button by its label, and avoid hangs when it fails. r=extension-reviewers,rpl
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

The patch landed in nightly and beta is affected.

:flod, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox161 to wontfix if the fix can wait for the next release.

Uplift requests can be submitted from Lando: D339511.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(francesco.lodolo)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes a couple of edge cases in a test (race condition, which might then result in a 90 minute hang).
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Only test fix
  • String changes made/needed?: -
  • Is Android affected?: no
Attachment #9677074 - Flags: approval-mozilla-beta?

The Stop button label is now set asynchronously by Fluent. If the test fails,
stop the hung script during cleanup, and let the hang notification fall back
to the add-on ID once the extension has been unloaded.

Original Revision: https://phabricator.services.mozilla.com/D339511

Flags: needinfo?(francesco.lodolo)
Attachment #9677074 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: