Closed Bug 1399018 Opened 8 years ago Closed 8 years ago

Intermittent test_expected.py TestExpected.test_element_displayed_when_stale_element | UnknownException: TypeError: el is null

Categories

(Testing :: Marionette Client and Harness, defect, P5)

Version 3
defect

Tracking

(firefox56 unaffected, firefox57 fix-optional)

RESOLVED FIXED
Tracking Status
firefox56 --- unaffected
firefox57 --- fix-optional

People

(Reporter: intermittent-bug-filer, Unassigned)

References

Details

(Keywords: intermittent-failure, regression)

Here the failing test: https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/testing/marionette/harness/marionette_harness/tests/unit/test_expected.py#146-151 The JS error stack looks like: 05:52:51 INFO - element.isStale@chrome://marionette/content/element.js:636:7 05:52:51 INFO - get@chrome://marionette/content/element.js:181:9 05:52:51 INFO - isElementDisplayed@chrome://marionette/content/listener.js:1431:12 05:52:51 INFO - dispatch/</req<@chrome://marionette/content/listener.js:515:16 05:52:51 INFO - async*dispatch/<@chrome://marionette/content/listener.js:513:16 It means that we have to caught the `TypeError` and let `isStale` return false, but that doesn't happen: https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/testing/marionette/element.js#635-643 It's a regression from the changes on bug 1394881. Andreas, can you please have a look?
Blocks: 1394881
Flags: needinfo?(ato)
Keywords: regression
Unable to reproduce this, but the only thing I can think of from the element.Store is that el.get(), is that it fails when unpacking the weak reference of the element: > get(uuid) { > let el = this.els[uuid]; > if (!el) { > throw new NoSuchElementError("Element reference not seen before: " + uuid); > } > > try { > el = el.get(); > } catch (e) { > el = null; > delete this.els[uuid]; > } > > if (element.isStale(el)) { > throw new StaleElementReferenceError( > pprint`The element reference of ${el} stale; ` + > "either the element is no longer attached to the DOM " + > "or the document has been refreshed"); > } > > return el; > } Arguably we should error when el.get() throws and the weak reference is deleted from the cache.
Flags: needinfo?(ato)
Depends on: 1399076
(In reply to Andreas Tolfsen ‹:ato› from comment #2) > Arguably we should error when el.get() throws and the weak > reference is deleted from the cache. Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1399076 to take care of this.
appears to have been fixed by bug 1399076
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Testing → Remote Protocol
Moving bug to Testing::Marionette Client and Harness component per bug 1815831.
Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing
You need to log in before you can comment on or make changes to this bug.