Closed Bug 812541 Opened 7 years ago Closed 7 years ago

[B2G] Launching Gaia apps occasionally fails showing the app partially launched


(Testing :: Marionette, defect, major)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: davehunt, Unassigned)




(1 file)

I've seen this a few times today using the emulator. The app appears, but only as a thumbnail before popping into view. The test eventually fails with a script timeout as demonstrated below. I have attached a screenshot of the app partially launched.

Traceback (most recent call last):
  File "/home/mozilla/gaia-ui-tests/gaiatest/tests/", line 14, in test_kill_all
  File "/home/mozilla/gaia-ui-tests/gaiatest/", line 63, in launch
    result = self.marionette.execute_async_script("GaiaApps.launchWithName('%s')" % name)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 435, in execute_async_script
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 188, in _send_message
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 237, in _handle_error
    raise ScriptTimeoutException(message=message, status=status, stacktrace=stacktrace)
TEST-UNEXPECTED-FAIL | TestKillAll.test_kill_all | ScriptTimeoutException: timed out

Subsequent tests then fail with the following exception:

Traceback (most recent call last):
  File "/home/mozilla/gaia-ui-tests/gaiatest/", line 195, in tearDown
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 132, in tearDown
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 333, in set_context
    return self._send_message('setContext', 'ok', value=context)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 188, in _send_message
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/", line 246, in _handle_error
    raise MarionetteException(message=response, status=500)
TEST-UNEXPECTED-FAIL | TestKillAll.test_kill_all_twice | MarionetteException: {u'from': u'conn47.marionette1', u'value': {u'origin': u'app://', u'src': u'app://', u'frame': u'appframe69', u'name': u'Clock'}}
Also saw this happen on device with

I wonder if the root cause that could be affecting this is the fact that the gaia-ui-tests framework isn't taking into account if the FTU app is up on a clean flash. I saw this bug reproduce in that situation.

Relevant gaia-ui-tests issue:
FWIW, in the occasions I have seen this, the FTU app has not been running.
I originally thought this had something to do with the FTU app as well, but additional experimentation seemed to show this was not the case.
Malini and I saw this today, and I made a YouTube video about it:
Adding David Scravaglieri and Vivien.

From the video, it looks like what's happening is that we're launching Calculator when it's already running, and it's getting stuck in Cards View for some reason.
It's a fresh boot-up so that shouldn't be the problem. Unless it's not a second Calculator app but a second app launching that causes the Cards view.
FWIW these problems seem much more severe on an emulator, so it may be some race condition which is getting triggered more frequently on the slower emulator.
I think this is because we're listening for the appopen event, which appears to fire when the cards view is still open. Switching to using mozbrowserfirstpaint as the comment in the code already suggests makes this work for me.

By the way, to reliably replicate just open several applications in one test. I got it to replicate most times. I will shortly open a pull request after seeing if this change causes any tests to regress.
(In reply to Dave Hunt (:davehunt) from comment #9)
> Fixed by has now landed; should this be marked RESOLVED FIXED, now, Dave?
Yes, I haven't seen this since. Please reopen if this reoccurs.
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.