Closed Bug 1060279 Opened 10 years ago Closed 10 years ago

After a desktopb2g crash in TBPL, get_device_manager in the mixin tries to get ADB device manager

Categories

(Remote Protocol :: Marionette, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: zcampbell, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

After a crash in desktopb2g/tbpl, the following tests fail when get_device_manager tries to use the ADB manager.

In this scenario get_device_manager should be returning None.

http://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/runner/mixins/b2g.py#47

Possibly the capabilities are not accurate and causing it to try to return the device's device manager.





Example failure on TBPL:


09:14:44     INFO -  TEST-START | test_settings_passcode.py TestSettingsPasscode.test_set_passcode_by_settings
09:14:44     INFO -  ['adb', 'version']
09:14:44    ERROR -  TEST-UNEXPECTED-ERROR | test_settings_passcode.py TestSettingsPasscode.test_set_passcode_by_settings | DMError: unable to execute ADB ([Errno 2] No such file or directory): ensure Android SDK is installed and adb is in your $PATH
09:14:44     INFO -  Traceback (most recent call last):
09:14:44     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/marionette_test.py", line 153, in run
09:14:44     INFO -      self.setUp()
09:14:44     INFO -    File "/builds/slave/talos-slave/test/gaia/tests/python/gaia-ui-tests/gaiatest/gaia_test.py", line 716, in setUp
09:14:44     INFO -      manager=self.device_manager,
09:14:44     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runner/mixins/b2g.py", line 52, in device_manager
09:14:44     INFO -      return self.get_device_manager()
09:14:44     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runner/mixins/b2g.py", line 47, in get_device_manager
09:14:44     INFO -      self._device_manager = get_dm(self.marionette, **kwargs)
09:14:44     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runner/mixins/b2g.py", line 18, in get_dm
09:14:44     INFO -      return mozdevice.DeviceManagerADB(**kwargs)
09:14:44     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/mozdevice/devicemanagerADB.py", line 65, in __init__
09:14:44     INFO -      self._verifyADB()
09:14:44     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/mozdevice/devicemanagerADB.py", line 608, in _verifyADB
09:14:44     INFO -      raise DMError("unable to execute ADB (%s): ensure Android SDK is installed and adb is in your $PATH" % err)
09:14:44     INFO -  TEST-INFO took 794ms
09:14:44     INFO -  TEST-START | test_power_button_long_press.py TestPowerButton.test_power_button_long_press
09:14:44     INFO -  ['adb', 'version']
Assignee: nobody → zcampbell
Attached patch bug_1060279.diff (obsolete) — Splinter Review
Attachment #8481275 - Flags: review?(mdas)
Attached patch bug_1060279.diffSplinter Review
Whichever one of you gets to it first..
Attachment #8481275 - Attachment is obsolete: true
Attachment #8481275 - Flags: review?(mdas)
Attachment #8481457 - Flags: review?(mdas)
Attachment #8481457 - Flags: review?(dave.hunt)
New Try:
https://tbpl.mozilla.org/?tree=Try&rev=125ab1244c2e

Kinda hoping for a crash so we can see if it recovers properly!
Comment on attachment 8481457 [details] [diff] [review]
bug_1060279.diff

Review of attachment 8481457 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm!
Attachment #8481457 - Flags: review?(mdas) → review+
I wanted this to run on macos Gip. Even though mdas has r+ it I'm going to run another Try
Here's a run with Mac Gip
https://tbpl.mozilla.org/?tree=Try&rev=70fb652f4d79

Triggered a few to try and get a crash, to see if we recover better.
Attachment #8481457 - Flags: review?(dave.hunt)
I can't get Gip to crash!! 

But this is r+ and Try is green. We can hardly make the crash handling any worse.
Keywords: checkin-needed
Tomcat, can you back this out of m-i, or stop it getting into m-c?

It causes issues with device crashes; I need to revisit it.
Flags: needinfo?(cbook)
Turns out I did make it worse.

The original bug is that after the desktopb2g or device crashes, capabilities is None. 
In the patch I protected against that in the desktopb2g scenario by removing the `!=` but then just moved it onto .lower() not being valid against None.

I will need to check capabilities for None and then return the correct DM.
Assignee: zcampbell → nobody
This will be done by the work in https://bugzilla.mozilla.org/show_bug.cgi?id=1038870
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: