Closed Bug 1368767 Opened 7 years ago Closed 6 years ago

Intermittent test_navigation.py TestNavigate.test_set_location_through_execute_script | AssertionError: 'Marionette Test' != u''

Categories

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

Version 3
defect

Tracking

(firefox59 wontfix, firefox60 fixed, firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox59 --- wontfix
firefox60 --- fixed
firefox61 --- fixed

People

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

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

[task 2017-05-30T12:30:12.967471Z] 12:30:12     INFO - TEST-UNEXPECTED-FAIL | test_navigation.py TestNavigate.test_set_location_through_execute_script | AssertionError: 'Marionette Test' != u''
[task 2017-05-30T12:30:12.967725Z] 12:30:12     INFO - Traceback (most recent call last):
[task 2017-05-30T12:30:12.967898Z] 12:30:12     INFO -   File "/home/worker/workspace/build/venv/local/lib/python2.7/site-packages/marionette_harness/marionette_test/testcases.py", line 166, in run
[task 2017-05-30T12:30:12.968103Z] 12:30:12     INFO -     testMethod()
[task 2017-05-30T12:30:12.968286Z] 12:30:12     INFO -   File "/home/worker/workspace/build/tests/marionette/tests/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py", line 114, in test_set_location_through_execute_script
[task 2017-05-30T12:30:12.968385Z] 12:30:12     INFO -     self.assertEqual("Marionette Test", self.marionette.title)

Gecko log shows a couple of warnings like:

1496147411428	Marionette	TRACE	1052 -> [0,25,"getTitle",{}]
[Parent 929] WARNING: Remote iframe not rendered: file /home/worker/workspace/build/src/layout/ipc/RenderFrameParent.cpp, line 176
1496147412470	Marionette	TRACE	1052 <- [1,25,null,{"value":""}]

The interesting fact is that we call `getCurrentUrl` right before which got changes today via bug 1368101. Not sure if this can be related. I would need more such failures. Also this is a headless job.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
I somewhat suspect that this is a Python issue.  Perhaps a string
passed across the socket is not getting properly deserialised as a
unicode value.  I have never seen this outside of Python.
https://wiki.mozilla.org/Bugmasters#Intermittent_Test_Failure_Cleanup
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → INCOMPLETE
(In reply to Andreas Tolfsen ‹:ato› from comment #10)
> I somewhat suspect that this is a Python issue.  Perhaps a string
> passed across the socket is not getting properly deserialised as a
> unicode value.  I have never seen this outside of Python.

No. getTitle() returns an empty string. While a linkedBrowser is available, the call to `linkedBrowser.contentTitle` is empty.
This is now more obvious since we get the title via the chrome process now (bug 1368439).
Priority: -- → P5
Ok, so the race condition we hit here might be caused by flaky test code:

>        Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
>            lambda mn: self.test_page_remote == mn.get_url(),
>            message="'{}' hasn't been loaded".format(self.test_page_remote))
>        self.assertEqual("Marionette Test", self.marionette.title)

Given that the URL is already shown in the location bar even before the page has been finished loading we break out of the `Wait().until()` call too early, and the title has not yet been set. Given that we cannot use the page load listener as provided by Marionette here, we need a better way to wait for the page being loaded.

I propose that we just wait for the title being set, and afterward compare the URL.

I'm going to provide a patch later today.
Ok, I can clearly reproduce the failure when replacing the locally served `test.html` with a real website. In that case we always fail in this test. My upcoming patch will fix it.
Assignee: nobody → hskupin
Status: REOPENED → ASSIGNED
Priority: P5 → P2
Attachment #8966203 - Flags: review?(ato)
Comment on attachment 8966203 [details]
Bug 1368767 - Fix race condition in test_set_location_through_execute_script.

https://reviewboard.mozilla.org/r/234964/#review240636
Attachment #8966203 - Flags: review?(ato) → review+
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4f6778d6135c
Fix race condition in test_set_location_through_execute_script. r=ato
https://hg.mozilla.org/mozilla-central/rev/4f6778d6135c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Low-frequent on mozilla-beta but small enough to uplift this test-only patch.
Whiteboard: [checkin-needed-beta]
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.

Attachment

General

Created:
Updated:
Size: