Closed Bug 1202576 Opened 5 years ago Closed 4 years ago

Hang in test_about_private_browsing.py (testCheckAboutPrivateBrowsing) if element cannot be found in a different chrome window

Categories

(Testing :: Firefox UI Tests, defect, critical)

43 Branch
defect
Not set
critical

Tracking

(firefox43 wontfix, firefox44 wontfix, firefox45 fixed, firefox46 fixed, firefox-esr38 wontfix)

RESOLVED FIXED
Tracking Status
firefox43 --- wontfix
firefox44 --- wontfix
firefox45 --- fixed
firefox46 --- fixed
firefox-esr38 --- wontfix

People

(Reporter: whimboo, Unassigned)

References

Details

(Keywords: hang, Whiteboard: [failure])

Seen today for functional tests of the Firefox 41.0b8 ar locale:
https://treeherder.mozilla.org/logviewer.html#?job_id=502371&repo=mozilla-beta

Whenever the referenced element 'learnMore' is not found the test hangs forever and Marionette does not kill the run even not after the global timeout. This might be a Marionette bug but would need some more investigation first.

To reproduce the problem do the following steps:

1. Clone https://github.com/mozilla/firefox-ui-tests
2. Open firefox_ui_tests/functional/private_browsing/test_about_private_browsing.py in your editor
3. Change the element 'learnMore' to 'learnMor'
4. Save and run this single test via 'firefox-ui-tests --binary Nightly firefox_ui_tests/functional/private_browsing/test_about_private_browsing.py'

This problem is causing bustage on our CI machines because Jenkins kills those builds but Marionette leaves Firefox instances behind. See bug 1201871. So the machine becomes unusable until all remaining Firefox and Python processes get killed manually.
Here the Marionette logging output:

1441698486615	Marionette	DEBUG	conn3 -> ({"name":"getChromeWindowHandles"})
1441698486616	Marionette	DEBUG	conn3 client <- ({"from":"0","value":["3","15"],"status":"success","sessionId":"27926ea2-b2cd-428b-99a8-ba592405c757"})
1441698486616	Marionette	DEBUG	conn3 -> ({"name":"getChromeWindowHandles"})
1441698486617	Marionette	DEBUG	conn3 client <- ({"from":"0","value":["3","15"],"status":"success","sessionId":"27926ea2-b2cd-428b-99a8-ba592405c757"})
1441698486617	Marionette	DEBUG	conn3 -> ({"name":"findElement","parameters":{"using":"id","value":"menu_closeWindow"}})
1441698486618	Marionette	DEBUG	conn3 client <- ({"from":"0","value":{"ELEMENT":"c921d6d2-85be-40d1-b39f-c3e6f5a4aada"},"status":"success","sessionId":"27926ea2-b2cd-428b-99a8-ba592405c757"})
1441698486619	Marionette	DEBUG	conn3 -> ({"name":"clickElement","parameters":{"id":"c921d6d2-85be-40d1-b39f-c3e6f5a4aada"}})
1441698486621	Marionette	DEBUG	conn3 client <- ({"from":"0","ok":true})
1441698486679	Marionette	DEBUG	conn3 -> ({"name":"getChromeWindowHandles"})
1441698486679	Marionette	DEBUG	conn3 client <- ({"from":"0","value":["3"],"status":"success","sessionId":"27926ea2-b2cd-428b-99a8-ba592405c757"})
1441698486681	Marionette	DEBUG	conn3 -> ({"name":"getContext"})
1441698486681	Marionette	DEBUG	conn3 client <- ({"from":"0","value":"chrome","status":"success","sessionId":"27926ea2-b2cd-428b-99a8-ba592405c757"})
1441698486682	Marionette	DEBUG	conn3 -> ({"name":"setContext","parameters":{"value":"chrome"}})
1441698486682	Marionette	DEBUG	conn3 client <- ({"from":"0","ok":true})
1441698486687	Marionette	DEBUG	conn3 -> ({"name":"takeScreenshot","parameters":{"highlights":null,"full":true,"id":null}})

Looks like the problem here is inside the takeScreenshot call which does not return. I will dig deeper.
It is actually bug 1141519 which is causing this problem for us. Reason is that an exception gets thrown in content scope.
Depends on: 1141519
Whiteboard: [failure] → [failure][blocked]
Depends on: 1197130
Depends on: 1202663
No longer depends on: 1141519
So the hang in screenshot is affecting us actually on all branches. So we have to wait for the fix on bug 1202663, which Andreas wants to continue on today.
Depends on: 1209441
The upgrade to marionette client and driver will not fix that. We have to wait for another release and bug 1202663 being fixed.
No longer depends on: 1197130, 1209441
Whiteboard: [failure][blocked] → [failure][blocked by bug 1202663]
It's still not working yet with latest Nightly builds. Currently I get the failure as logged as bug 1215502. Maybe that is still causing the hang? When I check the log I do not see a response from takeScreenshot:

1445252519738	Marionette	DEBUG	conn3 -> {"name":"setContext","parameters":{"value":"chrome"}}
1445252519738	Marionette	DEBUG	conn3 client <- {}
1445252519739	Marionette	DEBUG	conn3 -> {"name":"takeScreenshot","parameters":{"highlights":null,"full":true,"id":null}}
*************************
A coding exception was thrown in a Promise rejection callback.
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise

Full message: TypeError: 'toString' called on an object that does not implement interface Exception.
Full stack: error.isError@chrome://marionette/content/error.js:78:12
error.isWebDriverError@chrome://marionette/content/error.js:86:10
Flags: needinfo?(ato)
Has this been resolved now that bug 1202663 has landed?  I also looked into bug 1215502, and error.toJSON has since been removed.
Flags: needinfo?(ato)
We still seem to hang here with the latest released marionette client and driver:

  File "/home/henrik/.virtualenvs/fxtests/local/lib/python2.7/site-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/marionette.py", line 718, in _send_message
    raise IOError("process died with returncode %s" % returncode)

IOError: process died with returncode None


When I explicitly break the execution via Ctrl-C I see the following:

    rv['screenshot'] = marionette.screenshot()
  File "/home/henrik/.virtualenvs/fxtests/local/lib/python2.7/site-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/marionette.py", line 1957, in screenshot
    data = self._send_message("takeScreenshot", body, key="value")
  File "/home/henrik/.virtualenvs/fxtests/local/lib/python2.7/site-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/decorators.py", line 36, in _
    return func(*args, **kwargs)
  File "/home/henrik/.virtualenvs/fxtests/local/lib/python2.7/site-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/marionette.py", line 708, in _send_message
    msg = self.client.receive()
  File "/home/henrik/.virtualenvs/fxtests/local/lib/python2.7/site-packages/marionette_transport-1.0.0-py2.7.egg/marionette_transport/transport.py", line 178, in receive
    chunk = self.sock.recv(bytes_to_recv)

So we still hang in taking the screenshot, right?
Flags: needinfo?(ato)
Hm, maybe the JS error as logged as bug 1215502 is causing this hang?
Product: Mozilla QA → Testing
Yes, this is caused by bug 1215502.
Depends on: 1215502
Flags: needinfo?(ato)
Whiteboard: [failure][blocked by bug 1202663] → [failure][blocked by bug 1215502]
No longer depends on: 1215502
Depends on: 1215502
Depends on: 1238996
The fix for bug 1215502 made this hang disappear! I hope that we can also get it backported to 45 which will be our next ESR branch.
Status: NEW → RESOLVED
Closed: 4 years ago
No longer depends on: 1238996
Resolution: --- → FIXED
Whiteboard: [failure][blocked by bug 1215502] → [failure]
The patch did also land on mozilla-aurora. So all cleared for the ESR branch.
You need to log in before you can comment on or make changes to this bug.