Bug 1448697 - Try to use force-stop instead of kill to end remote applications; r=bc
authorGeoff Brown <gbrown@mozilla.com>
Mon, 26 Mar 2018 12:21:46 -0600
changeset 410047 5076991cfc9320fb3f29ff5e77c893938deece40
parent 410046 5c8cbf2a508896f718b339568d90215104a98f98
child 410048 7db3ccb6382a91c2a9cde511d6392c6ec1fbcb18
push id33717
push userbtara@mozilla.com
push dateTue, 27 Mar 2018 09:13:26 +0000
treeherdermozilla-central@40ef480efa7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1448697
milestone61.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 1448697 - Try to use force-stop instead of kill to end remote applications; r=bc This is important for running browser tests on some non-privileged devices, where kill may not be permitted.
build/mobile/remoteautomation.py
layout/tools/reftest/remotereftest.py
testing/mochitest/runrobocop.py
testing/mochitest/runtestsremote.py
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -411,11 +411,11 @@ class RemoteAutomation(Automation):
                     else:
                         return
                     retries += 1
                 try:
                     self.device.pkill(self.procName, sig=9, attempts=1)
                 except:
                     print "%s still alive after SIGKILL!" % self.procName
                 if self.device.process_exist(self.procName):
-                    self.device.pkill(self.procName)
+                    self.device.stop_application(self.procName)
             else:
-                self.device.pkill(self.procName)
+                self.device.stop_application(self.procName)
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -196,17 +196,17 @@ class RemoteReftest(RefTest):
 
         self.automation.deleteANRs()
         self.automation.deleteTombstones()
         self.device.clear_logcat()
 
         self.device.rm(self.remoteCache, force=True, recursive=True)
 
         procName = options.app.split('/')[-1]
-        self.device.pkill(procName)
+        self.device.stop_application(procName)
         if self.device.process_exist(procName):
             self.log.error("unable to kill %s before starting tests!" % procName)
 
     def findPath(self, paths, filename=None):
         for path in paths:
             p = path
             if filename:
                 p = os.path.join(p, filename)
--- a/testing/mochitest/runrobocop.py
+++ b/testing/mochitest/runrobocop.py
@@ -92,17 +92,17 @@ class RobocopTestRunner(MochitestDesktop
         # with future tests, typically because the old server is keeping the port in use.
         # Try to avoid those failures by checking for and killing servers before
         # trying to start new ones.
         self.killNamedProc('ssltunnel')
         self.killNamedProc('xpcshell')
         self.auto.deleteANRs()
         self.auto.deleteTombstones()
         procName = self.options.app.split('/')[-1]
-        self.device.pkill(procName)
+        self.device.stop_application(procName)
         if self.device.process_exist(procName):
             self.log.warning("unable to kill %s before running tests!" % procName)
         self.device.rm(self.remoteScreenshots, force=True, recursive=True)
         self.device.rm(self.remoteMozLog, force=True, recursive=True)
         self.device.mkdir(self.remoteMozLog)
         logParent = posixpath.dirname(self.remoteLogFile)
         self.device.rm(logParent, force=True, recursive=True)
         self.device.mkdir(logParent)
@@ -129,17 +129,17 @@ class RobocopTestRunner(MochitestDesktop
         self.log.debug("Servers started")
 
     def cleanup(self):
         """
            Cleanup at end of job run.
         """
         self.log.debug("Cleaning up...")
         self.stopServers()
-        self.device.pkill(self.options.app.split('/')[-1])
+        self.device.stop_application(self.options.app.split('/')[-1])
         uploadDir = os.environ.get('MOZ_UPLOAD_DIR', None)
         if uploadDir:
             self.log.debug("Pulling any remote moz logs and screenshots to %s." %
                            uploadDir)
             self.device.pull(self.remoteMozLog, uploadDir)
             self.device.pull(self.remoteScreenshots, uploadDir)
         MochitestDesktop.cleanup(self, self.options)
         if self.localProfile:
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -87,17 +87,17 @@ class MochiRemote(MochitestDesktop):
 
         self.remoteChromeTestDir = posixpath.join(
             options.remoteTestRoot,
             "chrome")
         self.device.rm(self.remoteChromeTestDir, force=True, recursive=True)
         self.device.mkdir(self.remoteChromeTestDir)
 
         procName = options.app.split('/')[-1]
-        self.device.pkill(procName)
+        self.device.stop_application(procName)
         if self.device.process_exist(procName):
             self.log.warning("unable to kill %s before running tests!" % procName)
 
         # Add Android version (SDK level) to mozinfo so that manifest entries
         # can be conditional on android_version.
         self.log.info(
             "Android sdk version '%s'; will use this to filter manifests" %
             str(self.device.version))