зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1698131 - Suppress websocket server errors in mochitests; r=jmaher
mod_pywebsocket3 inherits the stdout and stderr handles of its parent process (the mochitest harness), so anything printed by the websocket server will appear in the mochitest log. Most websocket server output is logged to a separate log file, but exceptions are dumped to stderr. test_worker_websocket2.html appropriately tests special unicode characters in the reason code used when closing the websocket. On Windows, under python-3, the special content of that reason code causes an exception in the mod_pywebsocket3 logging, which is reported to the mochitest log; the test still passes and the websocket server continues to run correctly, but the exception is picked up by the treeherder log parser as a "failure". This patch suppresses the websocket server stderr so that any exception reported by the websocket server will not affect test status directly. Differential Revision: https://phabricator.services.mozilla.com/D108308
This commit is contained in:
Родитель
d7f1d89a5e
Коммит
605df9dfee
|
@ -618,8 +618,14 @@ class WebSocketServer(object):
|
|||
]
|
||||
env = dict(os.environ)
|
||||
env["PYTHONPATH"] = os.pathsep.join(sys.path)
|
||||
# start the process
|
||||
self._process = mozprocess.ProcessHandler(cmd, cwd=SCRIPT_DIR, env=env)
|
||||
# Start the process. Ignore stderr so that exceptions from the server
|
||||
# are not treated as failures when parsing the test log.
|
||||
self._process = mozprocess.ProcessHandler(
|
||||
cmd,
|
||||
cwd=SCRIPT_DIR,
|
||||
env=env,
|
||||
processStderrLine=lambda _: None,
|
||||
)
|
||||
self._process.run()
|
||||
pid = self._process.pid
|
||||
self._log.info("runtests.py | Websocket server pid: %d" % pid)
|
||||
|
|
Загрузка…
Ссылка в новой задаче