Bug 1510258 - Fixup shutting down fennec, r=gbrown
authorJames Graham <james@hoppipolla.co.uk>
Fri, 30 Nov 2018 15:31:48 +0000
changeset 448989 7d17aa7e056119b29b713caa1bd63d575ad2cc56
parent 448988 ed149f9cf50a61f1a6f90f3163d89d809414d632
child 448990 a72c668be4352bd19d650019384ba44de24cc795
push id35139
push userccoroiu@mozilla.com
push dateSat, 01 Dec 2018 02:30:08 +0000
treeherdermozilla-central@22425b629a9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1510258 - Fixup shutting down fennec, r=gbrown Remove the desktop-only shutdown code and ensure that the app isn't running before the tests start, since we can't have multiple copies of the same app running at a time. Depends on D13088 Differential Revision: https://phabricator.services.mozilla.com/D13089
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py
@@ -180,37 +180,30 @@ class FennecBrowser(FirefoxBrowser):
                                            process_args={"processOutputLine": [self.on_output]})
         self.logger.debug("Starting %s" % self.package_name)
         # connect to a running emulator
         write_hosts_file(self.config, self.runner.device.device)
+        self.runner.stop()
         self.runner.start(debug_args=debug_args, interactive=self.debug_info and self.debug_info.interactive)
         self.logger.debug("%s Started" % self.package_name)
     def stop(self, force=False):
         if self.runner is not None:
-            try:
-                if self.runner.device.connected:
-                    if len(self.runner.device.device.list_forwards()) > 0:
-                        self.runner.device.device.remove_forwards(
-                            "tcp:{}".format(self.marionette_port))
-            except Exception:
-                traceback.print_exception(*sys.exc_info())
+            if (self.runner.device.connected and
+                len(self.runner.device.device.list_forwards()) > 0):
+                try:
+                    self.runner.device.device.remove_forwards(
+                        "tcp:{}".format(self.marionette_port))
+                except Exception:
+                    self.logger.warning("Failed to remove port forwarding")
             # We assume that stopping the runner prompts the
             # browser to shut down. This allows the leak log to be written
-            for clean, stop_f in [(True, lambda: self.runner.wait(self.shutdown_timeout)),
-                                  (False, lambda: self.runner.stop(signal.SIGTERM)),
-                                  (False, lambda: self.runner.stop(signal.SIGKILL))]:
-                if not force or not clean:
-                    retcode = stop_f()
-                    if retcode is not None:
-                        self.logger.info("Browser exited with return code %s" % retcode)
-                        break