Bug 1595245 - Translate remaining uncaught mozharness ADBErrors into task retries; r=bc
authorGeoff Brown <gbrown@mozilla.com>
Thu, 14 Nov 2019 15:45:45 +0000
changeset 501971 09cc380c54d905ad3834995698077c333f3e89a6
parent 501970 8b0098a03143ee4f81ae2f78d31ac960a62c1a8c
child 501972 ec6979a95056337dc316159ce353b39d98b86bd9
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1595245
milestone72.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 1595245 - Translate remaining uncaught mozharness ADBErrors into task retries; r=bc Most mozdevice access in mozharness was already encapsulated in try blocks, with only the shell_output() case neglected, consistent with the observed intermittent failures. Differential Revision: https://phabricator.services.mozilla.com/D52879
testing/mozharness/mozharness/mozilla/testing/android.py
--- a/testing/mozharness/mozharness/mozilla/testing/android.py
+++ b/testing/mozharness/mozharness/mozilla/testing/android.py
@@ -334,53 +334,61 @@ class AndroidMixin(object):
 
     def install_apk(self, apk, replace=False):
         """
            Install the specified apk.
         """
         import mozdevice
         try:
             self.device.install_app(apk, replace=replace)
-        except (mozdevice.ADBError, mozdevice.ADBTimeoutError) as e:
+        except (mozdevice.ADBError, mozdevice.ADBProcessError, mozdevice.ADBTimeoutError) as e:
             self.info('Failed to install %s on %s: %s %s' %
                       (apk, self.device_name,
                        type(e).__name__, e))
             self.fatal('INFRA-ERROR: %s Failed to install %s' %
                        (type(e).__name__, os.path.basename(apk)),
                        EXIT_STATUS_DICT[TBPL_RETRY])
 
     def uninstall_apk(self):
         """
            Uninstall the app associated with the configured apk, if it is
            installed.
         """
         import mozdevice
         try:
             package_name = self.query_package_name()
             self.device.uninstall_app(package_name)
-        except (mozdevice.ADBError, mozdevice.ADBTimeoutError) as e:
+        except (mozdevice.ADBError, mozdevice.ADBProcessError, mozdevice.ADBTimeoutError) as e:
             self.info('Failed to uninstall %s from %s: %s %s' %
                       (package_name, self.device_name,
                        type(e).__name__, e))
-            self.fatal('INFRA-ERROR: %s Failed to install %s' %
+            self.fatal('INFRA-ERROR: %s Failed to uninstall %s' %
                        (type(e).__name__, package_name),
                        EXIT_STATUS_DICT[TBPL_RETRY])
 
     def is_boot_completed(self):
         import mozdevice
         try:
             out = self.device.get_prop('sys.boot_completed', timeout=30)
             if out.strip() == '1':
                 return True
         except (ValueError, mozdevice.ADBError, mozdevice.ADBTimeoutError):
             pass
         return False
 
     def shell_output(self, cmd):
-        return self.device.shell_output(cmd, timeout=30)
+        try:
+            return self.device.shell_output(cmd, timeout=30)
+        except (mozdevice.ADBTimeoutError) as e:
+            self.info('Failed to run shell command %s from %s: %s %s' %
+                      (cmd, self.device_name,
+                       type(e).__name__, e))
+            self.fatal('INFRA-ERROR: %s Failed to run shell command %s' %
+                       (type(e).__name__, cmd),
+                       EXIT_STATUS_DICT[TBPL_RETRY])
 
     def device_screenshot(self, prefix):
         """
            On emulator, save a screenshot of the entire screen to the upload directory;
            otherwise, save a screenshot of the device to the upload directory.
 
            :param prefix specifies a filename prefix for the screenshot
         """