Bug 1231981 - Part 2.1: Only run the websocket/process bridge for media tests. r=ahal draft
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 27 Apr 2016 13:13:40 -0500
changeset 357877 34f4b174e630e21c429c173adfc44b4fbf54cd43
parent 357057 31da75e2a941d55dfafba73260254515f1ca9f0e
child 357878 3e8d6e0622d71925284ad164f90f01301d498faa
push id16877
push userbcampen@mozilla.com
push dateFri, 29 Apr 2016 19:01:27 +0000
reviewersahal
bugs1231981
milestone49.0a1
Bug 1231981 - Part 2.1: Only run the websocket/process bridge for media tests. r=ahal MozReview-Commit-ID: 3GBAGTSR08c
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -818,27 +818,30 @@ class MochitestBase(object):
         self.websocketProcessBridge = mozprocess.ProcessHandler(command,
                                                                 cwd=SCRIPT_DIR)
         self.websocketProcessBridge.run()
         self.log.info("runtests.py | websocket/process bridge pid: %d"
                       % self.websocketProcessBridge.pid)
 
         # ensure the server is up, wait for at most ten seconds
         for i in range(1,100):
+            if self.websocketProcessBridge.proc.poll() is not None:
+                self.log.error("runtests.py | websocket/process bridge failed "
+                               "to launch. Are all the dependencies installed?")
+                return
+
             try:
                 sock = socket.create_connection(("127.0.0.1", 8191))
                 sock.close()
                 break
             except:
                 time.sleep(0.1)
         else:
             self.log.error("runtests.py | Timed out while waiting for "
                            "websocket/process bridge startup.")
-            self.stopServers()
-            sys.exit(1)
 
     def startServers(self, options, debuggerInfo, ignoreSSLTunnelExts=False):
         # start servers and set ports
         # TODO: pass these values, don't set on `self`
         self.webServer = options.webServer
         self.httpPort = options.httpPort
         self.sslPort = options.sslPort
         self.webSocketPort = options.webSocketPort
@@ -847,17 +850,19 @@ class MochitestBase(object):
         # on the command line to select a particular version of httpd.js. If not
         # specified, try to select the one from hostutils.zip, as required in
         # bug 882932.
         if not options.httpdPath:
             options.httpdPath = os.path.join(options.utilityPath, "components")
 
         self.startWebServer(options)
         self.startWebSocketServer(options, debuggerInfo)
-        self.startWebsocketProcessBridge(options)
+
+        if options.subsuite in ["media"]:
+            self.startWebsocketProcessBridge(options)
 
         # start SSL pipe
         self.sslTunnel = SSLTunnel(
             options,
             logger=self.log,
             ignoreSSLTunnelExts=ignoreSSLTunnelExts)
         self.sslTunnel.buildConfig(self.locations)
         self.sslTunnel.start()