Intermittent /webdriver/tests/execute_script/arguments.py | test_element_reference[shadow-root] - AssertionError: javascript error (500): Cyclic object value
Categories
(Remote Protocol :: Marionette, defect, P5)
Tracking
(firefox-esr102 wontfix, firefox109 wontfix, firefox110 wontfix, firefox111 fixed)
People
(Reporter: intermittent-bug-filer, Assigned: whimboo)
References
Details
(Keywords: intermittent-failure)
Filed by: hskupin [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=360489909&repo=try
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/HrAZcTGkQBSlLfh58cduJQ/runs/0/artifacts/public/logs/live_backing.log
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/execute_script/collections.py | test_shadow_root - AssertionError: unknown error (500): TypeError: can't access property "documentElement", node.ownerDocument is null
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO - session = <Session 5d9ea162-ab8a-41dc-b966-1c0bd2ca4f83>
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO - inline = <function inline.<locals>.inline at 0x7f10bbd11d08>
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO -
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO - def test_shadow_root(session, inline):
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO - session.url = inline("""
[task 2021-12-08T08:24:23.235Z] 08:24:23 INFO - <style>
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - custom-checkbox-element {
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - display:block; width:20px; height:20px;
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - }
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - </style>
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - <custom-checkbox-element></custom-checkbox-element>
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - <script>
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - customElements.define('custom-checkbox-element',
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - class extends HTMLElement {
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - constructor() {
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - super();
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - this.attachShadow({mode: 'open'}).innerHTML = [task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - <div><input type="checkbox"/></div> [task 2021-12-08T08:24:23.236Z] 08:24:23 INFO -
;
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - }
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - });
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - </script>""")
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - custom_element = session.find.css("custom-checkbox-element", all=False)
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - expected = custom_element.shadow_root
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - response = execute_script(session,
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - "return document.querySelector('custom-checkbox-element').shadowRoot")
[task 2021-12-08T08:24:23.236Z] 08:24:23 INFO - > value = assert_success(response)
Note that the same test but for `Execute Async Script` works just fine.
Assignee | ||
Comment 1•3 years ago
|
||
Here is a simple test case for Marionette that reproduces the problem. And again only for sandbox=None
and not for Execute Async Script
:
def test_case(self):
page = inline("""
<style>
custom-checkbox-element {
display:block; width:20px; height:20px;
}
</style>
<custom-checkbox-element id="checkbox"></custom-checkbox-element>
<script>
customElements.define('custom-checkbox-element',
class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: 'open'}).innerHTML = `
<div><input type="checkbox"/></div>
`;
}
});
</script>""")
self.marionette.navigate(page)
self.marionette.execute_async_script("""
const resolve = arguments[0];
resolve(document.querySelector('custom-checkbox-element').shadowRoot);
""", sandbox=None)
self.marionette.execute_script("""
return document.querySelector('custom-checkbox-element').shadowRoot;
""", sandbox=None)
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 3•3 years ago
|
||
The exact stack of this failure is:
1639382595392 Marionette DEBUG 3 <- [1,4,{"error":"unknown error","message":"TypeError: can't access property "documentElement", node.ownerDocument is null","stacktrace":"element.isInXULDocument@chrome://remote/content/marionette/element.js:1353:1\nfrom@chrome://remote/content/marionette/element.js:1497:19\nelement.getElementId@chrome://remote/content/marionette/element.js:624:28\nevaluate.toJSON@chrome://remote/content/marionette/evaluate.js:348:20\nevaluate.toJSON@chrome://remote/content/marionette/evaluate.js:362:27\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:177:31\n"},null]
The first step here would be to fix the check at:
https://searchfox.org/mozilla-central/rev/4646b826a25d3825cf209db890862b45fa09ffc3/remote/marionette/element.js#1350-1353
As it looks like there are cases when ownerDocument
can be null
and that's causing the above failure. But when done so we will end-up with a cyclic error.
Comment 4•3 years ago
|
||
https://wiki.mozilla.org/Bug_Triage#Intermittent_Test_Failure_Cleanup
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 5•3 years ago
|
||
This is not fixed but marked as failed so it's expected to not cause failures.
Assignee | ||
Comment 6•2 years ago
|
||
Updating the bug's summary because of the changes for the failure as triggered by landing the patch on bug 1775064.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
With bug 1793920 fixed this will no longer be a stale element reference
error but a javascript error (500): Cyclic object value
.
Assignee | ||
Comment 8•2 years ago
|
||
With bug 1794078 the test is moved to arguments.py
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 9•2 years ago
|
||
Fixed by the patch on bug 1764594.
Comment 10•2 years ago
|
||
Description
•