Bug 1540078 - Let pywebsocket listen at localhost in mochitests r=ahal
authorRob Wu <rob@robwu.nl>
Fri, 29 Mar 2019 14:11:13 +0000
changeset 466759 a606559ac3b5e0d3d39ede9db07bbefec5be7577
parent 466758 98452610cfcc81cba0d4478797fe1e83a51172e8
child 466760 6f1c417146beb1a143d87cbb95b69a723853048b
push id35780
push useropoprus@mozilla.com
push dateFri, 29 Mar 2019 21:53:01 +0000
treeherdermozilla-central@414f37afbe07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1540078
milestone68.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 1540078 - Let pywebsocket listen at localhost in mochitests r=ahal Not specifying an explicit host causes pywebsocket to listen on the default address, which may be 0.0.0.0. This triggers the firewall on macOS, and causes the following prompt to be shown when mochitests are run: > Do you want the application "Python.app" > to accept incoming network connections? The dialog is a nuisance because it is always on top. Since denying the access does not change the outcome of tests, it should be safe to only listen on localhost. Differential Revision: https://phabricator.services.mozilla.com/D25364
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -565,18 +565,18 @@ class WebSocketServer(object):
         # If we're not in an interactive debugger, the wrapper causes the server to
         # die silently upon receiving a SIGINT.
         scriptPath = 'pywebsocket_wrapper.py'
         script = os.path.join(self._scriptdir, scriptPath)
 
         cmd = [sys.executable, script]
         if self.debuggerInfo and self.debuggerInfo.interactive:
             cmd += ['--interactive']
-        cmd += ['-p', str(self.port), '-w', self._scriptdir, '-l',
-                os.path.join(self._scriptdir, "websock.log"),
+        cmd += ['-H', '127.0.0.1', '-p', str(self.port), '-w', self._scriptdir,
+                '-l', os.path.join(self._scriptdir, "websock.log"),
                 '--log-level=debug', '--allow-handlers-outside-root-dir']
         # start the process
         self._process = mozprocess.ProcessHandler(cmd, cwd=SCRIPT_DIR)
         self._process.run()
         pid = self._process.pid
         self._log.info("runtests.py | Websocket server pid: %d" % pid)
 
     def stop(self):