Bug 1359288 - Enable Android reftest to resume from crashes. r=jmaher
authorShing Lyu <slyu@mozilla.com>
Wed, 10 May 2017 10:38:48 +0800
changeset 360055 3241038a0214844fe761d7aa08a7244e77347d58
parent 360054 146fefaee64c96e6c6380dd38d34d59be5a18ec8
child 360056 90d9d225e54f33ee8d9ae50b43c070ebafce6782
push id43195
push userslyu@mozilla.com
push dateTue, 23 May 2017 03:23:13 +0000
treeherderautoland@3241038a0214 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1359288
milestone55.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 1359288 - Enable Android reftest to resume from crashes. r=jmaher MozReview-Commit-ID: EqTOdEwfTWi
build/automation.py.in
layout/tools/reftest/remotereftest.py
testing/mochitest/runrobocop.py
testing/mochitest/runtests.py
testing/mochitest/runtestsremote.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -580,14 +580,14 @@ class Automation(object):
     crashed = self.checkForCrashes(os.path.join(profileDir, "minidumps"), symbolsPath)
 
     if crashed or zombieProcesses:
       status = 1
 
     if os.path.exists(processLog):
       os.unlink(processLog)
 
-    return status
+    return status, self.lastTestSeen
 
   def elf_arm(self, filename):
     data = open(filename, 'rb').read(20)
     return data[:4] == "\x7fELF" and ord(data[18]) == 40 # EM_ARM
 
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -307,26 +307,26 @@ class RemoteReftest(RefTest):
         if "XPCOM_MEM_BLOAT_LOG" in browserEnv:
             del browserEnv["XPCOM_MEM_BLOAT_LOG"]
         return browserEnv
 
     def runApp(self, profile, binary, cmdargs, env,
                timeout=None, debuggerInfo=None,
                symbolsPath=None, options=None,
                valgrindPath=None, valgrindArgs=None, valgrindSuppFiles=None):
-        status = self.automation.runApp(None, env,
-                                        binary,
-                                        profile.profile,
-                                        cmdargs,
-                                        utilityPath=options.utilityPath,
-                                        xrePath=options.xrePath,
-                                        debuggerInfo=debuggerInfo,
-                                        symbolsPath=symbolsPath,
-                                        timeout=timeout)
-        return status, None
+        status, lastTestSeen = self.automation.runApp(None, env,
+                                                      binary,
+                                                      profile.profile,
+                                                      cmdargs,
+                                                      utilityPath=options.utilityPath,
+                                                      xrePath=options.xrePath,
+                                                      debuggerInfo=debuggerInfo,
+                                                      symbolsPath=symbolsPath,
+                                                      timeout=timeout)
+        return status, lastTestSeen
 
     def cleanup(self, profileDir):
         # Pull results back from device
         if self.remoteLogFile and \
                 self._devicemanager.fileExists(self.remoteLogFile):
             self._devicemanager.getFile(self.remoteLogFile, self.localLogName)
         else:
             print "WARNING: Unable to retrieve log file (%s) from remote " \
--- a/testing/mochitest/runrobocop.py
+++ b/testing/mochitest/runrobocop.py
@@ -454,17 +454,17 @@ class RobocopTestRunner(MochitestDesktop
             self.log.info("")
         result = -1
         log_result = -1
         try:
             self.dm.recordLogcat()
             timeout = self.options.timeout
             if not timeout:
                 timeout = self.NO_OUTPUT_TIMEOUT
-            result = self.auto.runApp(
+            result, _ = self.auto.runApp(
                 None, browserEnv, "am", self.localProfile, browserArgs,
                 timeout=timeout, symbolsPath=self.options.symbolsPath)
             self.log.debug("runApp completes with status %d" % result)
             if result != 0:
                 self.log.error("runApp() exited with code %s" % result)
             if self.dm.fileExists(self.remoteLog):
                 self.dm.getFile(self.remoteLog, self.localLog)
                 self.dm.removeFile(self.remoteLog)
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2163,17 +2163,17 @@ toolbar#nav-bar {
                 status = 1
 
         finally:
             # cleanup
             if os.path.exists(processLog):
                 os.remove(processLog)
             self.urlOpts = []
 
-        return status
+        return status, self.lastTestSeen
 
     def initializeLooping(self, options):
         """
           This method is used to clear the contents before each run of for loop.
           This method is used for --run-by-dir and --bisect-chunk.
         """
         self.expectedError.clear()
         self.result.clear()
@@ -2484,17 +2484,17 @@ toolbar#nav-bar {
                 testURL = self.buildTestURL(options, scheme=scheme)
 
                 self.buildURLOptions(options, self.browserEnv)
                 if self.urlOpts:
                     testURL += "?" + "&".join(self.urlOpts)
 
                 self.log.info("runtests.py | Running with e10s: {}".format(options.e10s))
                 self.log.info("runtests.py | Running tests: start.\n")
-                ret = self.runApp(
+                ret, _ = self.runApp(
                     testURL,
                     self.browserEnv,
                     options.app,
                     profile=self.profile,
                     extraArgs=options.browserArgs,
                     utilityPath=options.utilityPath,
                     debuggerInfo=debuggerInfo,
                     valgrindPath=valgrindPath,
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -281,17 +281,18 @@ class MochiRemote(MochitestDesktop):
         # automation.py/remoteautomation `runApp` takes the profile path,
         # whereas runtest.py's `runApp` takes a mozprofile object.
         if 'profileDir' not in kwargs and 'profile' in kwargs:
             kwargs['profileDir'] = kwargs.pop('profile').profile
 
         # remove args not supported by automation.py
         kwargs.pop('marionette_args', None)
 
-        return self._automation.runApp(*args, **kwargs)
+        ret, _ = self._automation.runApp(*args, **kwargs)
+        return ret, None
 
 
 def run_test_harness(parser, options):
     parser.validate(options)
 
     message_logger = MessageLogger(logger=None)
     process_args = {'messageLogger': message_logger}
     auto = RemoteAutomation(None, "fennec", processArgs=process_args)