Open Bug 1767716 Opened 4 years ago Updated 5 days ago

Intermittent devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js | single tracking bug

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jmaher, Unassigned)

References

Details

(Keywords: intermittent-failure, intermittent-testcase, leave-open, Whiteboard: [stockwell disabled])

Attachments

(4 files, 1 obsolete file)

No description provided.

Filter on devtools-intermittent-singletrackingbug-triage

Severity: -- → S4

Update

There have been 47 total failures within the last 7 days:

  • 28 failures on Linux 18.04 x64 WebRender debug/ opt
  • 16 failures on Linux 18.04 x64 WebRender Shippable opt
  • 3 failures on Windows 11 x64 22H2 WebRender Shippable opt

Recent failure log: https://treeherder.mozilla.org/logviewer?job_id=437628583&repo=autoland&lineNumber=6688

[task 2023-11-24T22:37:31.247Z] 22:37:31     INFO - TEST-PASS | devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js | a new breakpoint was created - 
[task 2023-11-24T22:37:31.248Z] 22:37:31     INFO - Invoking in tab: fetchFromWorker()
[task 2023-11-24T22:37:31.249Z] 22:37:31     INFO - Waiting for the debugger to pause
[task 2023-11-24T22:37:31.249Z] 22:37:31     INFO - Waiting for state change: paused
[task 2023-11-24T22:37:31.250Z] 22:37:31     INFO - Buffered messages finished
[task 2023-11-24T22:37:31.251Z] 22:37:31     INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js | Test timed out - 
[task 2023-11-24T22:37:31.251Z] 22:37:31     INFO - Removing tab.
[task 2023-11-24T22:37:31.252Z] 22:37:31     INFO - Waiting for event: 'TabClose' on [object XULElement].
[task 2023-11-24T22:37:31.264Z] 22:37:31     INFO - Got event: 'TabClose' on [object XULElement].
[task 2023-11-24T22:37:31.282Z] 22:37:31     INFO - Tab removed and finished closing
[task 2023-11-24T22:37:31.288Z] 22:37:31     INFO - GECKO(2665) | JavaScript error: , line 0: NotFoundError: No such JSWindowActor 'DevToolsFrame'
[task 2023-11-24T22:37:31.294Z] 22:37:31     INFO - Console message: [JavaScript Error: "NotFoundError: No such JSWindowActor 'DevToolsFrame'"]
[task 2023-11-24T22:37:31.296Z] 22:37:31     INFO - TEST-PASS | devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js | The main process DevToolsServer has no pending connection when the test ends - 

Hubert, can you help us assign this to someone?
Thank you.

Flags: needinfo?(hmanilla)
Whiteboard: [stockwell needswork:owner]
Keywords: leave-open

Hi Natalia, Apologies for the delay to get to this.

Alex , Does this relate to the latest work around service workers?
this test seems to be failing for the non-fission scenario, so could we ignore the test for this?

Flags: needinfo?(hmanilla) → needinfo?(poirot.alex)
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e977aed6ff8c Disable browser_dbg-windowless-service-workers-reload.js on linux and windows opt for frequent failures. r=jmaher
Whiteboard: [stockwell disable-recommended] → [stockwell disabled]
  • removeTab doesn't wait for full toolbox destruction
  • we weren't waiting for the ContentTask involved when calling fetchFromWorker to complete after resume
  • we were reloading the page while the Service Worker was still being registered
Attachment #9441714 - Attachment description: Bug 1767716 - Fix browser_dbg-windowless-service-workers-reload.js intermittents → Bug 1767716 - [devtools] Fix browser_dbg-windowless-service-workers-reload.js intermittents.
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb2ae095e16f [devtools] Fix browser_dbg-windowless-service-workers-reload.js intermittents. r=devtools-reviewers,bomsy

Backed out for causing dt failures @ browser_dbg-windowless-service-workers.js |

TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers.js | Found the service worker info -
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6efeb715eda2 [devtools] Fix browser_dbg-windowless-service-workers-reload.js intermittents. r=devtools-reviewers,bomsy
Flags: needinfo?(poirot.alex)

The recent failures seem related to a leak:

[task 2026-04-09T05:21:22.925+00:00] 05:21:22     INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js | Shutdown - leaked window until shutdown [url = about:devtools-toolbox]
[task 2026-04-09T05:21:22.925+00:00] 05:21:22     INFO - FragmentOrElement (xhtml) button class='devtools-button command-bar-button debugger-settings-menu-button' (orphan) chrome://devtools/content/debugger/index.html [root, 1 unknown ref(s)] @ 0x1aa86713700
[task 2026-04-09T05:21:22.925+00:00] 05:21:22     INFO -   Preserved wrapper  JS HTMLButtonElement @ 0x21dd110ad498
[task 2026-04-09T05:21:22.925+00:00] 05:21:22     INFO -   baseshape_global  JS Window @ 0x35269a4d8348
[task 2026-04-09T05:21:22.925+00:00] 05:21:22     INFO -   UnwrapDOMObject(obj)  nsGlobalWindowInner # 38 inner chrome://devtools/content/debugger/index.html @ 0x1aa87890d00
[task 2026-04-09T05:21:22.925+00:00] 05:21:22     INFO -   mTopInnerWindow  nsGlobalWindowInner # 35 inner about:devtools-toolbox @ 0x1aafe0d8f00
[task 2026-04-09T05:21:22.926+00:00] 05:21:22     INFO - Not taking screenshot here: see the one that was previously logged

The spike only started at the beginning of April 2026, so very recent regression.

(In reply to Julian Descottes [:jdescottes] from comment #129)

The spike only started at the beginning of April 2026, so very recent regression.

It's failing only on standalone jobs: https://tests.firefox.dev/test.html?test=devtools%2Fclient%2Fdebugger%2Ftest%2Fmochitest%2Fbrowser_dbg-windowless-service-workers-reload.js

So it's not necessarily a recent regression, but more likely when we introduced the standalone jobs.

See Also: → 2026744
Depends on: 2033980
Attached image image.png

Failure screenshots all seem to share the same symptom: the title tooltip of the sources settings button remains displayed.

Maybe the toolbox it destroyed while the tooltip is shown and that's potentially what triggers the bug?

I tried setting the tooltip delay to 0, but interestingly that makes the issue a permafail: https://treeherder.mozilla.org/jobs?repo=try&selectedTaskRun=GK8tX8CMSLyfWSjtLsaV1Q.0&revision=6fe4d5fcf456813f4922778a74a44f258167e8d8

Now trying to increase the delay from 500ms to 10s: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=37975

But as far as actually fixing this we probably need a way to make sure all title tooltips are properly destroyed when destroying a window. I wonder if this is something specific to the toolbox or if it can impact any title tooltip?

I was trying to see where the leak was coming from, and it might be related to https://searchfox.org/firefox-main/rev/a78cfde410d7bb58c143d46f3dea0af8ec0181f3/docshell/base/nsDocShellTreeOwner.cpp#171-178

// The node hovered over that fired the timer. This may turn into the node
// that triggered the tooltip, but only if the timer ever gets around to
// firing. This is a strong reference, because the tooltip content can be
// destroyed while we're waiting for the tooltip to pop up, and we need to
// detect that. It's set only when the tooltip timer is created and launched.
// The timer must either fire or be cancelled (or possibly released?), and we
// release this reference in each of those cases. So we don't leak.
nsCOMPtr<nsINode> mPossibleTooltipNode;

It seems that at least in case the window is programmatically destroyed while the tooltip is shown, we don't clear the reference?

FWIW, it's relatively easy to reproduce manually, even on macos.

With a debug build, add "ui.tooltip.delay_ms=0", right below https://searchfox.org/firefox-main/rev/f98aa512e7b7d557ec2d57dbf67b0c4285e9cd3a/devtools/client/debugger/test/mochitest/browser_qz.toml#19

"javascript.options.experimental.explicit_resource_management=true", # This pref has to be set before the process starts

Then run devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js in headful and move your mouse on top of the cog icon of the source tree of the debugger during the test (or make sure your mouse is positioned at the coordinates of the button when the test will start, both approaches work here)

Attachment #9572642 - Attachment description: Bug 1767716 - Hide Tooltip in nsXULTooltipListener::RemoveTooltipSupport → Bug 1767716 - Fix window leak when tooltip source document is unloaded r?#layout-reviewers

Initially tried to fix the window leak from Bug 1767716 with this approach but it
did not help. Still keeping the patch in the stack in case it makes sense.

Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7e6b3486735b https://hg.mozilla.org/integration/autoland/rev/dd2a75bede17 Fix window leak when tooltip source document is unloaded r=layout-reviewers,emilio
Attachment #9574395 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: