Closed Bug 1360512 Opened 8 years ago Closed 7 years ago

Various tests leak two windows with screenshots enabled as a Legacy WebExtension (browser_CTP_drag_drop.js, devtools browser_window_close.js & others)

Categories

(WebExtensions :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: standard8, Unassigned)

References

Details

(Whiteboard: triaged)

Enabling screenshots shows leaks in various tests. Try build: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e3bb8f193bd9d2d3e9ce96b77b34270c73af6461&selectedJob=94887399 https://treeherder.mozilla.org/logviewer.html#?job_id=94875205&repo=try&lineNumber=3249 ERROR - TEST-UNEXPECTED-FAIL | browser/base/content/test/plugins/browser_CTP_drag_drop.js | leaked 1 window(s) until shutdown [url = chrome://browser/content/browser.xul] ERROR - TEST-UNEXPECTED-FAIL | browser/base/content/test/plugins/browser_CTP_drag_drop.js | leaked 1 window(s) until shutdown [url = about:blank] https://treeherder.mozilla.org/logviewer.html#?job_id=94887399&repo=try&lineNumber=9146 ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_window_close.js | leaked 2 window(s) until shutdown [url = chrome://devtools/content/responsive.html/index.xhtml] ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_window_close.js | leaked 1 window(s) until shutdown [url = about:blank] ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_window_close.js | leaked 1 window(s) until shutdown [url = chrome://browser/content/browser.xul] INFO - TEST-INFO | devtools/client/responsive.html/test/browser/browser_window_close.js | windows(s) leaked: [pid = 1862] [serial = 308], [pid = 1862] [serial = 312], [pid = 1862] [serial = 298], [pid = 1862] [serial = 297] ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_exit_button.js | leaked 1 window(s) until shutdown [url = chrome://browser/content/browser.xul] ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_exit_button.js | leaked 1 window(s) until shutdown [url = about:blank] INFO - TEST-INFO | devtools/client/responsive.html/test/browser/browser_exit_button.js | windows(s) leaked: [pid = 1862] [serial = 78], [pid = 1862] [serial = 79] ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_menu_item_02.js | leaked 1 window(s) until shutdown [url = about:blank] ERROR - TEST-UNEXPECTED-FAIL | devtools/client/responsive.html/test/browser/browser_menu_item_02.js | leaked 1 window(s) until shutdown [url = chrome://browser/content/browser.xul] INFO - TEST-INFO | devtools/client/responsive.html/test/browser/browser_menu_item_02.js | windows(s) leaked: [pid = 1862] [serial = 115], [pid = 1862] [serial = 114]
I took a brief look at these, the only thing I could see were lines in both logs similar to: JavaScript error: chrome://browser/content/ext-utils.js, line 0: Error: Invalid tab ID: 106 Console message: [JavaScript Error: "Error: Invalid tab ID: 106" {file: "chrome://browser/content/ext-utils.js" line: 0}] JavaScript error: undefined, line 0: Error: Invalid tab ID: 100 JavaScript error: undefined, line 0: Error: Invalid tab ID: 100 Console message: [JavaScript Error: "Error: Invalid tab ID: 100" {file: "undefined" line: 0}] Console message: [JavaScript Error: "Error: Invalid tab ID: 100" {file: "undefined" line: 0}] We've already seen cases where this throws an error (https://github.com/mozilla-services/screenshots/commit/11ec0806235ed45d4c292dcc077a1713e134e4c9). The Screenshots code is trying to listen for browser.tabs.onActivated / browser.tabs.onUpdated and when the listener is triggered within screenshots, getting the tab for the id throws the error above - presumably because it has opened & closed very quickly. Therefore I'm wondering if there's something the WebExtension API might be holding on to in this instance. This could, of course, be a red herring, but could be a starting point.
I don't think these leaks are real. I think the extension just happens to startup during these tests, and the window creation gets reported as a leak.
I think your best option is probably to just startup the extension as early as possible when running mochitests. But *not* when running under talos.
(In reply to Kris Maglione [:kmag] (busy; behind on reviews) from comment #3) > I think your best option is probably to just startup the extension as early > as possible when running mochitests. But *not* when running under talos. As I understand it, that's what bug 1362234 has just done. However, these are still showing up in my latest try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ac58b8b3c33146661ffdb796e80cd98bcd19fd03 Any more ideas?
Flags: needinfo?(kmaglione+bmo)
Priority: -- → P1
Whiteboard: triaged
I've re-done a try build, and this is no longer an issue. Probably due to the recent webextension improvements :-)
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(kmaglione+bmo)
Resolution: --- → WORKSFORME
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.