Closed Bug 1785201 Opened 2 years ago Closed 1 year ago

JavaScript error: chrome://remote/content/shared/TabManager.jsm, line 311: TypeError: can't access property "linkedBrowser", tab is undefined

Categories

(Remote Protocol :: Agent, defect, P1)

defect
Points:
1

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

(Whiteboard: [webdriver:m5])

Attachments

(1 file)

Seen for the intermittent failure on bug 1785171:

https://treeherder.mozilla.org/logviewer?job_id=387565753&repo=mozilla-central&lineNumber=1918-1924

[task 2022-08-17T00:18:09.462Z] 00:18:09     INFO - TEST-START | /css/css-multicol/column-balancing-paged-001-print.html
[task 2022-08-17T00:18:09.473Z] 00:18:09     INFO - Setting pref dom.animations-api.compositing.enabled to true
[task 2022-08-17T00:18:09.484Z] 00:18:09     INFO - Setting pref layout.css.cascade-layers.enabled to true
[task 2022-08-17T00:18:09.546Z] 00:18:09     INFO - PID 8436 | 1660695489545	Marionette	INFO	Testing http://web-platform.test:8000/css/css-multicol/column-balancing-paged-001-print.html == http://web-platform.test:8000/css/css-multicol/column-balancing-paged-001-print-ref.html
[task 2022-08-17T00:18:09.551Z] 00:18:09     INFO - PID 8436 | JavaScript error: chrome://remote/content/shared/TabManager.jsm, line 311: TypeError: can't access property "linkedBrowser", tab is undefined
[task 2022-08-17T00:18:34.463Z] 00:18:34     INFO - Got timeout in harness
[task 2022-08-17T00:18:34.466Z] 00:18:34     INFO - TEST-UNEXPECTED-TIMEOUT | /css/css-multicol/column-balancing-paged-001-print.html | TestRunner hit external timeout (this may indicate a hang)

Some callee of _getWindowForTab() (addTab, selectTab or remoteTab) is passing undefined as tab. As such it might be good to have a check that the tab is valid.

Severity: -- → S3
Priority: -- → P3
Whiteboard: [webdriver:backlog]
See Also: → 1778891
Blocks: 1778891
See Also: 1778891
No longer blocks: 1785171

Note that this failure can actually be seen a lot of times in any Wr log even if the job passes:
https://firefoxci.taskcluster-artifacts.net/AYh84TEDT2Spl9ZPT43NzQ/0/public/logs/live_backing.log

Here an except from a trace log:

mach wpt --setpref="remote.log.level=Trace" testing/web-platform/tests/animation-worklet/worklet-animation-cancel.https.html

 0:14.50 pid:34864 1669148199644	Marionette	DEBUG	Starting load of http://web-platform.test:8000/animation-worklet/references/not-translated-box-ref.html
 0:14.51 pid:34864 JavaScript error: chrome://remote/content/shared/TabManager.sys.mjs, line 331: TypeError: can't access property "linkedBrowser", tab is undefined
 0:14.51 pid:34864 1669148199650	Marionette	TRACE	[13] Reftest actor created for window id 28
 0:14.52 pid:34864 1669148199658	Marionette	TRACE	[13] Reftest actor created for window id 8589934593

The actual stack of the failure is the following:

 0:12.97 pid:36666 _getWindowForTab@chrome://remote/content/shared/TabManager.sys.mjs:335:15
 0:12.97 pid:36666 selectTab@chrome://remote/content/shared/TabManager.sys.mjs:313:30
 0:12.97 pid:36666 switchToTab@chrome://remote/content/marionette/browser.sys.mjs:309:29
 0:12.97 pid:36666 register@chrome://remote/content/marionette/browser.sys.mjs:335:12
 0:12.97 pid:36666 GeckoDriver.prototype.registerBrowser@chrome://remote/content/marionette/driver.sys.mjs:383:21
 0:12.97 pid:36666 GeckoDriver.prototype.setWindowHandle@chrome://remote/content/marionette/driver.sys.mjs:1265:12
 0:12.97 pid:36666 ensureWindow@chrome://remote/content/marionette/reftest.sys.mjs:167:23

So it fails when we are trying to focus the tab after switching to it:
https://searchfox.org/mozilla-central/rev/650c19c96529eb28d081062c1ca274bc50ef3635/remote/marionette/browser.sys.mjs#302-310

And here is the problem. For reftests we only have a faked win.gBrowser that doesn't contain actual tabs. It means we cannot switch to any tab and should return early similar to when no gBrowser is available.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED

Hi Henrik. Can you assign points.

Flags: needinfo?(hskupin)
Priority: P3 → P1
Whiteboard: [webdriver:backlog] → [webdriver:m5]
Points: --- → 1
Flags: needinfo?(hskupin)
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3f38f2ad982d
[marionette] Don't select the tab when switching to a reftest window. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Duplicate of this bug: 1778891
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: