Closed Bug 1223676 Opened 9 years ago Closed 9 years ago

[B2G] Intermitten ScriptTimeout on waiting HomeScreen

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox45 fixed)

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

Details

Attachments

(1 file)

      No description provided.
http://ftp.mozilla.org/pub/mozilla.org/b2g/try-builds/echen@mozilla.com-3b3951f95f9f/try-emulator/try_ubuntu64_vm-b2g-emulator_test-marionette-webapi-bm123-tests1-linux64-build918.txt.gz

04:20:17     INFO -  waiting for system-message-listener-ready...
04:20:49     INFO -  ...done
04:22:22     INFO -  waiting for homescreen...
04:27:40     INFO -  Failure during test execution.
04:27:40     INFO -  Traceback (most recent call last):
04:27:40     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/runtests.py", line 70, in run
04:27:40     INFO -      runner.run_tests(tests)
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/marionette/runner/base.py", line 784, in run_tests
04:27:40     INFO -      self.marionette.emulator.wait_for_homescreen(self.marionette)
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/mozrunner/utils.py", line 90, in _
04:27:40     INFO -      ret = func(*args, **kwargs)
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/mozrunner/devices/emulator.py", line 223, in wait_for_homescreen
04:27:40     INFO -      });""", script_timeout=300000)
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/marionette_driver/marionette.py", line 1706, in execute_async_script
04:27:40     INFO -      rv = self._send_message("executeAsyncScript", body, key="value")
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/marionette_driver/decorators.py", line 36, in _
04:27:40     INFO -      return func(*args, **kwargs)
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/marionette_driver/marionette.py", line 721, in _send_message
04:27:40     INFO -      self._handle_error(err)
04:27:40     INFO -    File "/builds/slave/test/build/venv/local/lib/python2.7/site-packages/marionette_driver/marionette.py", line 782, in _handle_error
04:27:40     INFO -      raise errors.lookup(error)(message, stacktrace=stacktrace)
04:27:40     INFO -  ScriptTimeoutException: ScriptTimeoutException: timed out
04:27:44    ERROR -  Exception OSError: OSError(2, 'No such file or directory') in <bound method Marionette.__del__ of <marionette_driver.marionette.Marionette object at 0x27d2a10>> ignored
Summary: [B2G] Script → [B2G] ScriptTimeout on waiting HomeScreen
Summary: [B2G] ScriptTimeout on waiting HomeScreen → [B2G] Intermitten ScriptTimeout on waiting HomeScreen
This timeout happens often on my try push [1] recently. After checking the log, I found it is because marionette waits for homescreen's `mozbrowserloadend` event, but sometimes the homescreen is launched earlier than marionette starts waiting the event. In such case, we got a scriptTimeout.

To fix this we can,
1). Having a better way to handle waiting homescreen, e.g. if homescreen is launched already, we don't have to wait the `mozbrowserloadend` event.
2). Remove waiting homescreen. 

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=4a6c16769f92&group_state=expanded&exclusion_profile=false
(In reply to Edgar Chen [:edgar][:echen] from comment #2)
> This timeout happens often on my try push [1] recently. After checking the
> log, I found it is because marionette waits for homescreen's
> `mozbrowserloadend` event, but sometimes the homescreen is launched earlier
> than marionette starts waiting the event. In such case, we got a
> scriptTimeout.
> 
> To fix this we can,
> 1). Having a better way to handle waiting homescreen, e.g. if homescreen is
> launched already, we don't have to wait the `mozbrowserloadend` event.
> 2). Remove waiting homescreen. 

These code is added in bug 926280. Not sure if we could remove it.
I will do some tests to see if it is okay to remove it. 

> 
> [1]
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=4a6c16769f92&group_state=expanded&exclusion_profile=fa
> lse
Blocks: 1081529
(In reply to Edgar Chen [:edgar][:echen] from comment #3)
> (In reply to Edgar Chen [:edgar][:echen] from comment #2)
> > This timeout happens often on my try push [1] recently. After checking the
> > log, I found it is because marionette waits for homescreen's
> > `mozbrowserloadend` event, but sometimes the homescreen is launched earlier
> > than marionette starts waiting the event. In such case, we got a
> > scriptTimeout.
> > 
> > To fix this we can,
> > 1). Having a better way to handle waiting homescreen, e.g. if homescreen is
> > launched already, we don't have to wait the `mozbrowserloadend` event.
> > 2). Remove waiting homescreen. 
> 
> These code is added in bug 926280. Not sure if we could remove it.
> I will do some tests to see if it is okay to remove it. 

The result is positive, MNW and MNW-OOP (applying the patch of bug 1075437) both work good without waiting homescreen. I think it is safe to remove it.

> 
> > 
> > [1]
> > https://treeherder.mozilla.org/#/
> > jobs?repo=try&revision=4a6c16769f92&group_state=expanded&exclusion_profile=fa
> > lse
Bug 1223676 - [Marionette] Remove waiting for homescreen on emulator
Assignee: nobody → echen
Comment on attachment 8685919 [details]
MozReview Request: Bug 1223676 - [Marionette] Remove waiting for homescreen on emulator

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/24919/diff/1-2/
Attachment #8685919 - Flags: review?(ahalberstadt)
Attachment #8685919 - Flags: review?(ahalberstadt) → review+
Comment on attachment 8685919 [details]
MozReview Request: Bug 1223676 - [Marionette] Remove waiting for homescreen on emulator

https://reviewboard.mozilla.org/r/24919/#review22465

::: testing/marionette/client/marionette/runner/base.py
(Diff revision 1)
> -            if self.emulator:
> -                self.marionette.emulator.wait_for_homescreen(self.marionette)

I have a feeling this is going to break mochitest/reftest/xpcshell on emulators. Please run a try run with all emulator unittests, not just marionette.

r+ on the condition that the above try run comes back green. Thanks for investigating this!
(In reply to Andrew Halberstadt [:ahal] from comment #8)
> Comment on attachment 8685919 [details]
> MozReview Request: Bug 1223676 - [Marionette] Remove waiting for homescreen
> on emulator
> 
> https://reviewboard.mozilla.org/r/24919/#review22465
> 
> ::: testing/marionette/client/marionette/runner/base.py
> (Diff revision 1)
> > -            if self.emulator:
> > -                self.marionette.emulator.wait_for_homescreen(self.marionette)
> 
> I have a feeling this is going to break mochitest/reftest/xpcshell on
> emulators. Please run a try run with all emulator unittests, not just
> marionette.

Sure, I will make sure it won't affect any emulator tests before land. Thank you. 

> 
> r+ on the condition that the above try run comes back green. Thanks for
> investigating this!
https://hg.mozilla.org/mozilla-central/rev/18c814ad7be9
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
See Also: → 1062786
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: