Closed Bug 1202576 Opened 8 years ago Closed 7 years ago

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


(Testing :: Firefox UI Tests, defect)

43 Branch
Not set


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

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


(Reporter: whimboo, Unassigned)



(Keywords: hang, Whiteboard: [failure])

Seen today for functional tests of the Firefox 41.0b8 ar locale:

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
2. Open firefox_ui_tests/functional/private_browsing/ 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/'

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.

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
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/", 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/", 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/", 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/", 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/", 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.
Closed: 7 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.