Closed Bug 1677005 Opened 4 years ago Closed 4 years ago

Intermittent /webdriver/<test_path> | <test> - AssertionError: assert 'no such element' == 'stale element reference'

Categories

(Remote Protocol :: Marionette, defect, P5)

defect

Tracking

(firefox-esr78 unaffected, firefox83 unaffected, firefox84 wontfix, firefox85 fixed, firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox83 --- unaffected
firefox84 --- wontfix
firefox85 --- fixed
firefox86 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: whimboo)

References

Details

(Keywords: assertion, intermittent-failure)

Filed by: btara [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=321635296&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/fMc4wRTSTW6W3AdnanwzrA/runs/0/artifacts/public/logs/live_backing.log


...
[task 2020-11-13T00:30:18.753Z] 00:30:18     INFO - PID 5504 | 1605227418748	webdriver::server	DEBUG	<- 200 OK {"value":null}
[task 2020-11-13T00:30:18.754Z] 00:30:18     INFO - STDOUT: ================================== FAILURES ===================================
[task 2020-11-13T00:30:18.755Z] 00:30:18     INFO - STDOUT: ________________________________ test_is_stale ________________________________
[task 2020-11-13T00:30:18.755Z] 00:30:18     INFO - STDOUT: session = <Session 386203f9-17c4-4077-b554-1302a9386aa2>
[task 2020-11-13T00:30:18.756Z] 00:30:18     INFO - STDOUT:     def test_is_stale(session):
[task 2020-11-13T00:30:18.757Z] 00:30:18     INFO - STDOUT:         session.url = inline("<button>foo</button>")
[task 2020-11-13T00:30:18.757Z] 00:30:18     INFO - STDOUT:         button = session.find.css("button", all=False)
[task 2020-11-13T00:30:18.758Z] 00:30:18     INFO - STDOUT:         session.url = inline("<button>bar</button>")
[task 2020-11-13T00:30:18.759Z] 00:30:18     INFO - STDOUT:     
[task 2020-11-13T00:30:18.759Z] 00:30:18     INFO - STDOUT:         response = element_click(session, button)
[task 2020-11-13T00:30:18.760Z] 00:30:18     INFO - STDOUT: >       assert_error(response, "stale element reference")
[task 2020-11-13T00:30:18.760Z] 00:30:18     INFO - STDOUT: button     = <Element 2ec54a97-ba3d-4051-8274-4f7ec5827d69>
[task 2020-11-13T00:30:18.760Z] 00:30:18     INFO - STDOUT: response   = <Response status=404 error=<NoSuchElementException http_status=404>>
[task 2020-11-13T00:30:18.761Z] 00:30:18     INFO - STDOUT: session    = <Session 386203f9-17c4-4077-b554-1302a9386aa2>
[task 2020-11-13T00:30:18.762Z] 00:30:18     INFO - STDOUT: tests\web-platform\tests\webdriver\tests\element_click\stale.py
[task 2020-11-13T00:30:18.763Z] 00:30:18     INFO - STDOUT: :18: 
[task 2020-11-13T00:30:18.764Z] 00:30:18     INFO - STDOUT: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2020-11-13T00:30:18.764Z] 00:30:18     INFO - STDOUT: response = <Response status=404 error=<NoSuchElementException http_status=404>>
[task 2020-11-13T00:30:18.764Z] 00:30:18     INFO - STDOUT: error_code = 'stale element reference'
[task 2020-11-13T00:30:18.765Z] 00:30:18     INFO - STDOUT:     def assert_error(response, error_code):
[task 2020-11-13T00:30:18.765Z] 00:30:18     INFO - STDOUT:         """
[task 2020-11-13T00:30:18.766Z] 00:30:18     INFO - STDOUT:         Verify that the provided webdriver.Response instance described
[task 2020-11-13T00:30:18.767Z] 00:30:18     INFO - STDOUT:         a valid error response as defined by `dfn-send-an-error` and
[task 2020-11-13T00:30:18.767Z] 00:30:18     INFO - STDOUT:         the provided error code.
[task 2020-11-13T00:30:18.768Z] 00:30:18     INFO - STDOUT:     
[task 2020-11-13T00:30:18.768Z] 00:30:18     INFO - STDOUT:         :param response: ``webdriver.Response`` instance.
[task 2020-11-13T00:30:18.769Z] 00:30:18     INFO - STDOUT:         :param error_code: String value of the expected error code
[task 2020-11-13T00:30:18.770Z] 00:30:18     INFO - STDOUT:         """
[task 2020-11-13T00:30:18.770Z] 00:30:18     INFO - STDOUT:         assert response.status == errors[error_code]
[task 2020-11-13T00:30:18.771Z] 00:30:18     INFO - STDOUT:         assert "value" in response.body
[task 2020-11-13T00:30:18.772Z] 00:30:18     INFO - STDOUT: >       assert response.body["value"]["error"] == error_code
[task 2020-11-13T00:30:18.772Z] 00:30:18     INFO - STDOUT: E       AssertionError: assert 'no such element' == 'stale element reference'
[task 2020-11-13T00:30:18.773Z] 00:30:18     INFO - STDOUT: E         - no such element
[task 2020-11-13T00:30:18.774Z] 00:30:18     INFO - STDOUT: E         + stale element reference
[task 2020-11-13T00:30:18.775Z] 00:30:18     INFO - STDOUT: error_code = 'stale element reference'
[task 2020-11-13T00:30:18.775Z] 00:30:18     INFO - STDOUT: response   = <Response status=404 error=<NoSuchElementException http_status=404>>
[task 2020-11-13T00:30:18.775Z] 00:30:18     INFO - STDOUT: tests\web-platform\tests\webdriver\tests\support\asserts.py
[task 2020-11-13T00:30:18.776Z] 00:30:18     INFO - STDOUT: :54: AssertionError
[task 2020-11-13T00:30:18.776Z] 00:30:18     INFO - STDOUT: ============================== warnings summary ===============================
[task 2020-11-13T00:30:18.776Z] 00:30:18     INFO - STDOUT: <undetermined location>
[task 2020-11-13T00:30:18.776Z] 00:30:18     INFO - STDOUT:   Module already imported so cannot be rewritten: tests.support.fixtures
[task 2020-11-13T00:30:18.776Z] 00:30:18     INFO - STDOUT: -- Docs: http://doc.pytest.org/en/latest/warnings.html
[task 2020-11-13T00:30:18.777Z] 00:30:18     INFO - STDOUT: ==================== 1 failed, 1 warnings in 0.23 seconds =====================
[task 2020-11-13T00:30:18.812Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.812Z] 00:30:18     INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/element_click/stale.py | test_is_stale - AssertionError: assert 'no such element' == 'stale element reference'
[task 2020-11-13T00:30:18.812Z] 00:30:18     INFO - session = <Session 386203f9-17c4-4077-b554-1302a9386aa2>
[task 2020-11-13T00:30:18.812Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.812Z] 00:30:18     INFO -     def test_is_stale(session):
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO -         session.url = inline("<button>foo</button>")
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO -         button = session.find.css("button", all=False)
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO -         session.url = inline("<button>bar</button>")
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO -     
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO -         response = element_click(session, button)
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - >       assert_error(response, "stale element reference")
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - button     = <Element 2ec54a97-ba3d-4051-8274-4f7ec5827d69>
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - response   = <Response status=404 error=<NoSuchElementException http_status=404>>
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - session    = <Session 386203f9-17c4-4077-b554-1302a9386aa2>
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - tests\web-platform\tests\webdriver\tests\element_click\stale.py:18: 
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2020-11-13T00:30:18.813Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO - response = <Response status=404 error=<NoSuchElementException http_status=404>>
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO - error_code = 'stale element reference'
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -     def assert_error(response, error_code):
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -         """
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -         Verify that the provided webdriver.Response instance described
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -         a valid error response as defined by `dfn-send-an-error` and
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -         the provided error code.
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -     
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -         :param response: ``webdriver.Response`` instance.
[task 2020-11-13T00:30:18.814Z] 00:30:18     INFO -         :param error_code: String value of the expected error code
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO -         """
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO -         assert response.status == errors[error_code]
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO -         assert "value" in response.body
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - >       assert response.body["value"]["error"] == error_code
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - E       AssertionError: assert 'no such element' == 'stale element reference'
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - E         - no such element
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - E         + stale element reference
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - error_code = 'stale element reference'
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - response   = <Response status=404 error=<NoSuchElementException http_status=404>>
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - 
[task 2020-11-13T00:30:18.815Z] 00:30:18     INFO - tests\web-platform\tests\webdriver\tests\support\asserts.py:54: AssertionError
[task 2020-11-13T00:30:18.816Z] 00:30:18     INFO - TEST-OK | /webdriver/tests/element_click/stale.py | took 321ms```

Maja, could this be related to your patch on bug 1665718?

Flags: needinfo?(mjzffr)

Yes, that patch series did change when NoSuchElementError is thrown. This failure seems to be a low-frequency intermittent so far, which is weird for that kind of test assertion.

I cannot reproduce it locally with --verify.

If it becomes more frequent, we should push to try with trace logs enabled.

Flags: needinfo?(mjzffr)
Summary: Intermittent /webdriver/tests/element_click/stale.py | test_is_stale - AssertionError: assert 'no such element' == 'stale element reference' → Intermittent /webdriver/<test_path> | test_is_stale - AssertionError: assert 'no such element' == 'stale element reference'
Summary: Intermittent /webdriver/<test_path> | test_is_stale - AssertionError: assert 'no such element' == 'stale element reference' → Intermittent /webdriver/<test_path> | <test> - AssertionError: assert 'no such element' == 'stale element reference'

Should be fixed by bug 1684827.

Depends on: 1684827

Should no longer happen with bug 1684827 fixed.

Assignee: nobody → hskupin
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Beta is still affected and we would like to uplift the patch soon.

Moving bug to Remote Protocol::Marionette component per bug 1815831.
Component: geckodriver → Marionette
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.