Closed Bug 812541 Opened 7 years ago Closed 7 years ago

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

Categories

(Testing :: Marionette, defect, major)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: davehunt, Unassigned)

References

Details

Attachments

(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/test_killall.py", line 14, in test_kill_all
    self.apps.launch(app)
  File "/home/mozilla/gaia-ui-tests/gaiatest/gaia_test.py", line 63, in launch
    result = self.marionette.execute_async_script("GaiaApps.launchWithName('%s')" % name)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette.py", line 435, in execute_async_script
    specialPowers=special_powers)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette.py", line 188, in _send_message
    self._handle_error(response)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette.py", line 237, in _handle_error
    raise ScriptTimeoutException(message=message, status=status, stacktrace=stacktrace)
TEST-UNEXPECTED-FAIL | test_killall.py 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/gaia_test.py", line 195, in tearDown
    MarionetteTestCase.tearDown(self)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette_test.py", line 132, in tearDown
    self.marionette.set_context("content")
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette.py", line 333, in set_context
    return self._send_message('setContext', 'ok', value=context)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette.py", line 188, in _send_message
    self._handle_error(response)
  File "/home/mozilla/mozilla-central/testing/marionette/client/marionette/marionette.py", line 246, in _handle_error
    raise MarionetteException(message=response, status=500)
TEST-UNEXPECTED-FAIL | test_killall.py TestKillAll.test_kill_all_twice | MarionetteException: {u'from': u'conn47.marionette1', u'value': {u'origin': u'app://clock.gaiamobile.org', u'src': u'app://clock.gaiamobile.org/index.html', u'frame': u'appframe69', u'name': u'Clock'}}
Also saw this happen on device with test_calculator.py.

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: https://github.com/mozilla/gaia-ui-tests/issues/8
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: https://www.youtube.com/watch?v=RIhSc3A1hvs&feature=plcp
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 https://github.com/mozilla/gaia-ui-tests/pull/115

https://github.com/mozilla/gaia-ui-tests/pull/115 has now landed; should this be marked RESOLVED FIXED, now, Dave?
Yes, I haven't seen this since. Please reopen if this reoccurs.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.