Closed Bug 1697588 Opened 4 years ago Closed 4 years ago

Perma toolkit/components/printing/tests/browser_modal_print.js | leaked 2 window(s) until shutdown [url = about:blank]

Categories

(Core :: Print Preview, defect)

defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: florian, Assigned: florian)

References

Details

Attachments

(1 file)

I see this failure permanently if I fix bug 1596165.

Adding await TestUtils.waitForTick(); at https://searchfox.org/mozilla-central/rev/ca910762568921c0faa34838d6a4efac2471dff1/toolkit/components/printing/tests/browser_modal_print.js#54 fixes it.

Here's a profile of what happens during this very short additional wait time: https://share.firefox.dev/3qBtkgH
I notice especially the "Runnable - NotifyUnhandledRejections" marker.

Olli, can you see how closing the dialog holding the about:blank window before this NotifyUnhandledRejections runnable had a change to run could cause us to keep a reference to the window until shutdown?

Flags: needinfo?(bugs)
Blocks: 1596165

Is there some particular reason why NotifyUnhandledRejections is interesting in this case?

Are you adding the await before or after closing the dialog?

Window closing certainly has asynchronous parts, like https://searchfox.org/mozilla-central/rev/87a8afd9f57ee4bc542ba0ec3f96a891042b6db7/dom/base/nsGlobalWindowOuter.cpp#6068-6071

But hard to say anything useful.

Flags: needinfo?(bugs)

(In reply to Olli Pettay [:smaug] from comment #1)

Is there some particular reason why NotifyUnhandledRejections is interesting in this case?

It's one of the only 2 runnables that get executed in the additional time I need to wait to avoid the leak.
The other one is "Runnable - PWindowGlobal::Msg_RawMessage" (I don't know what this does).

Are you adding the await before or after closing the dialog?

Before.

If you want to reproduce, you can apply the patch from bug 1596165 and run ./mach test toolkit/components/printing/tests/browser_modal_print.js on a debug build.

Applying the patch I added in this bug avoids the leak.

Pushed by fqueze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fff4922776e9 avoid leaking about:blank windows in browser_modal_print.js by waiting a bit before closing the dialog, r=emalysz.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: