Bug 1483586 - Avoid task retry if adb pull fails on code coverage file. r=gbrown
authorTudor-Gabriel Vîjială <tvijiala@mozilla.com>
Thu, 16 Aug 2018 16:52:41 +0000
changeset 431951 b26c8a754e40
parent 431950 2b5fc64beafb
child 431952 0e1d62e81cb1
push id67861
push userrvandermeulen@mozilla.com
push dateThu, 16 Aug 2018 18:30:02 +0000
treeherderautoland@b26c8a754e40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1483586
milestone63.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 1483586 - Avoid task retry if adb pull fails on code coverage file. r=gbrown Catch the exception if adb pull fails on code coverage file, to avoid task retry. Differential Revision: https://phabricator.services.mozilla.com/D3503
testing/mochitest/runjunit.py
--- a/testing/mochitest/runjunit.py
+++ b/testing/mochitest/runjunit.py
@@ -10,17 +10,17 @@ import shutil
 import sys
 import tempfile
 import traceback
 
 import mozcrash
 import mozinfo
 import mozlog
 import moznetwork
-from mozdevice import ADBAndroid
+from mozdevice import ADBAndroid, ADBError
 from mozprofile import Profile, DEFAULT_PORTS
 from mozprofile.permissions import ServerLocations
 from runtests import MochitestDesktop, update_mozinfo
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 try:
     from mozbuild.base import (
@@ -267,17 +267,24 @@ class JUnitTestRunner(MochitestDesktop):
             self.log.info("Todo: %d" % self.todo_count)
         finally:
             self.log.suite_end()
 
         if self.check_for_crashes():
             self.fail_count = 1
 
         if self.options.coverage:
-            self.device.pull(self.remote_coverage_output_path, self.options.coverage_output_path)
+            try:
+                self.device.pull(self.remote_coverage_output_path,
+                                 self.options.coverage_output_path)
+            except ADBError:
+                # Avoid a task retry in case the code coverage file is not found.
+                self.log.error("No code coverage file (%s) found on remote device" %
+                               self.remote_coverage_output_path)
+                return -1
 
         return 1 if self.fail_count else 0
 
     def check_for_crashes(self):
         logcat = self.device.get_logcat()
         if logcat:
             if mozcrash.check_for_java_exception(logcat, self.current_full_name):
                 return True