Closed Bug 1353447 Opened 4 years ago Closed 4 years ago
_navigation .py Test Back Forward Navigation .test _timeout _error | No Such Element Exception: Unable to locate element: delay
59 bytes, text/x-review-board-request
08:05:07 INFO - Traceback (most recent call last): 08:05:07 INFO - File "c:\slave\test\build\venv\lib\site-packages\marionette_harness\marionette_test\testcases.py", line 166, in run 08:05:07 INFO - testMethod() 08:05:07 INFO - File "c:\slave\test\build\tests\marionette\tests\testing\marionette\harness\marionette_harness\tests\unit\test_navigation.py", line 464, in test_timeout_error 08:05:07 INFO - self.assertEqual(self.marionette.find_element(By.ID, "delay").text, "4") 08:05:07 INFO - File "c:\slave\test\build\venv\lib\site-packages\marionette_driver\marionette.py", line 1938, in find_element 08:05:07 INFO - return self._send_message("findElement", body, key="value") 08:05:07 INFO - File "c:\slave\test\build\venv\lib\site-packages\marionette_driver\decorators.py", line 23, in _ 08:05:07 INFO - return func(*args, **kwargs) 08:05:07 INFO - File "c:\slave\test\build\venv\lib\site-packages\marionette_driver\marionette.py", line 735, in _send_message 08:05:07 INFO - self._handle_error(err) 08:05:07 INFO - File "c:\slave\test\build\venv\lib\site-packages\marionette_driver\marionette.py", line 768, in _handle_error 08:05:07 INFO - raise errors.lookup(error)(message, stacktrace=stacktrace) Interesting here is that this is happening now after a forward navigation. So it means we somehow return too early from it, and the element 'delay' is not present yet. This might have been caused by the patches on bug 1291320. It looks like a low intermittent failure.
I ran into this in my data from activedata about failures in real time.
Whiteboard: [stockwell needswork]
:whimboo, can you put this in your queue to debug or help find the right person to look at this? The failure rate is steady and I see us needing to address this in the coming weeks.
Here the exact failing code: https://dxr.mozilla.org/mozilla-central/rev/a374c35469935a874fefe64d3e07003fc5bc8884/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py#444-453 This is all after the last call to `goBack()`. Given that a timeout error was raised, the command returns before the expected page has been fully loaded. So we have this extra call to `getCurrentUrl`. Now the interesting fact is that this command doesn't care about the page load status. And as such returns the new URL once it appears in the location bar. The test now tries to find the element `delay` which might not be present yet. To fix that we should move the `find_element()` call into `Wait().until()`. I will try to have a fix by today.
Assignee: nobody → hskupin
Comment on attachment 8860897 [details] Bug 1353447 - Fix race condition in TestBackForwardNavigation.test_timeout_error. https://reviewboard.mozilla.org/r/132910/#review135742
Attachment #8860897 - Flags: review?(ato) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/b4d2716a7b58 Fix race condition in TestBackForwardNavigation.test_timeout_error. r=ato
Whiteboard: [stockwell needswork] → [stockwell fixed]
If you want this to land on esr52 too, it'll need a rebased patch.
So far there are no crashes on mozilla-esr52, so I don't think it's useful to spend the time on a backport patch. If it starts failing there, we can re-evaluate.
You need to log in before you can comment on or make changes to this bug.