Bug 1499902 - Improve device failure handling in AndroidMixin; r=bc
authorGeoff Brown <gbrown@mozilla.com>
Fri, 19 Oct 2018 08:43:19 -0600
changeset 500694 ab5f788c2759a9f9b0aa7977b504812879bf38b1
parent 500693 fc083f953b3e7afbfd697b8c1091bee5ad88ea74
child 500695 162dc0f0dbd53c31b50b1b1a062568b38f448078
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1499902
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499902 - Improve device failure handling in AndroidMixin; r=bc AndroidMixin properties are queried by mozharness prior to __init__ completion, so AttributeError is expected and is fairly safe to ignore, but other exceptions should be reported.
testing/mozharness/mozharness/mozilla/testing/android.py
--- a/testing/mozharness/mozharness/mozilla/testing/android.py
+++ b/testing/mozharness/mozharness/mozilla/testing/android.py
@@ -50,25 +50,25 @@ class AndroidMixin(object):
                 # have completed initialization. We recover afterwards
                 # when additional attemps occur after initialization
                 # is completed.
                 pass
         return self._adb_path
 
     @property
     def device(self):
-        if not self._device:
+        if not self._device and self.adb_path:
             try:
                 import mozdevice
                 self._device = mozdevice.ADBAndroid(adb=self.adb_path,
                                                     device=self.device_serial,
                                                     verbose=True)
                 self.info("New mozdevice with adb=%s, device=%s" %
                           (self.adb_path, self.device_serial))
-            except Exception:
+            except AttributeError:
                 # As in adb_path, above.
                 pass
         return self._device
 
     @property
     def is_android(self):
         try:
             c = self.config