Closed Bug 1668790 Opened 4 years ago Closed 4 years ago

(actors) testing/marionette/harness/marionette_harness/tests/unit/test_expected.py TestExpected.<test> - UnknownException: Error: The element reference of <p> is stale

Categories

(Remote Protocol :: Marionette, defect, P1)

Default
defect

Tracking

(firefox-esr78 unaffected, firefox82 unaffected, firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox82 --- unaffected
firefox83 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [marionette-fission-mvp][simple])

Attachments

(1 file)

While running all the Marionette unit tests with actors enabled I noticed that the given tests currently perma fail:

0:03.25 INFO test_expected.py test_expected.TestExpected.test_element_displayed_when_stale_element
0:03.25 INFO test_expected.py test_expected.TestExpected.test_element_not_displayed_when_stale_element
0:03.25 INFO test_expected.py test_expected.TestExpected.test_element_stale

It actually regressed with my first patch from bug 1662460.

Here the error details:

ERROR testing/marionette/harness/marionette_harness/tests/unit/test_expected.py TestExpected.test_element_displayed_when_stale_element - UnknownException: Error: The element reference of <p> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed
stacktrace:
	WebDriverError@chrome://marionette/content/error.js:181:5
	StaleElementReferenceError@chrome://marionette/content/error.js:442:5
	element.resolveElement@chrome://marionette/content/element.js:808:11
	evaluate.fromJSON@chrome://marionette/content/evaluate.js:233:26
	evaluate.fromJSON@chrome://marionette/content/evaluate.js:253:29
	receiveMessage@chrome://marionette/content/actors/MarionetteFrameChild.jsm:56:27
Traceback (most recent call last):

It should hopefully be simple to get fixed.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Priority: P2 → P1

The problem here is that we now no longer raise a stale element reference but unknown error error:

before:

1601642508323 Marionette DEBUG 2 <- [1,8,{"error":"stale element reference","message":"The element reference of <p> is stale; either the element is no longer att ... /MarionetteFrameChild.jsm:378:21\nreceiveMessage@chrome://marionette/content/actors/MarionetteFrameChild.jsm:108:31\n"},null]

now:

1601642318325 Marionette DEBUG 2 <- [1,8,{"error":"unknown error","message":"Error: The element reference of <p> is stale; either the element is no longer attach ... onette/content/evaluate.js:258:29\nreceiveMessage@chrome://marionette/content/actors/MarionetteFrameChild.jsm:56:27\n"},null]

And it's easy to fix. So formerly we resolved the element id to a DOM node within the appropriate method as called by receiveMessage, but now it's done directly in evaluate.fromJSON(serializedData):

https://searchfox.org/mozilla-central/rev/222e4f64b769413ac1a1991d2397b13a0acb5d9d/testing/marionette/actors/MarionetteFrameChild.jsm#57-61

Note that if an error is thrown we no longer send back an actual error type, but a result.

Without catching the error from evaluate.fromJSON() the default error handling
will kick-in and an UnknownError will be returned.

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e74872af6889
[marionette] Keep error class from evaluate.fromJSON() in MarionetteFrameChild.receiveMessage(). r=marionette-reviewers,maja_zf DONTBUILD
Summary: Intermittent (actors) testing/marionette/harness/marionette_harness/tests/unit/test_expected.py TestExpected.<test> - UnknownException: Error: The element reference of <p> is stale → (actors) testing/marionette/harness/marionette_harness/tests/unit/test_expected.py TestExpected.<test> - UnknownException: Error: The element reference of <p> is stale
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: