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 487122 b26c8a754e401eb122d45711efb803b5c63c1c59
parent 487034 2b5fc64beafb876827e00921db1bd4112b13b7f5
child 487123 0e1d62e81cb1fd01fa992a51446dea4d6ec92663
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [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