Bug 1456525 [wpt PR 10654] - [Gecko Bug 1456525] Fix wpt ws[s] server intermittent startup issue, a=testonly
authormoz-wptsync-bot <wptsync@mozilla.com>
Tue, 01 May 2018 14:56:15 +0000
changeset 472669 24e904d3e8221c92932dfb4de9f70de791287815
parent 472668 e6e2cb4c1553e48518126438d8c43ae24d10bc57
child 472670 b6a3b6789d460b704ddb6fb31897aaf9b0164319
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1456525, 10654
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 1456525 [wpt PR 10654] - [Gecko Bug 1456525] Fix wpt ws[s] server intermittent startup issue, a=testonly Automatic update from web-platform-testsFix wpt ws[s] server intermittent startup issue Running wpt occasionally failed due to an issue starting the ws[s] servers. This turns out to be a deadlock caused by a logging lock being inherited into the child process, sometimes in a locked state. As a workaround, after spawning the subprocess, we reload the logging module in order to clear any existing lock. This is pretty much a hack, but it's the fastest path to a solution to a critical issue. bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1456525 gecko-commit: 3c548f1fdf4dbac4c11bfc239e129864db547e4c gecko-integration-branch: mozilla-inbound gecko-reviewers: ato -- Fix Python 3 compatibility -- wpt-commits: 2ae9668bd0f23edf15d0591aeb90060dbd2565c2, 8f9b8153e139423dcd74598818ad3f7bd7e35c9f wpt-pr: 10654
testing/web-platform/tests/tools/serve/serve.py
--- a/testing/web-platform/tests/tools/serve/serve.py
+++ b/testing/web-platform/tests/tools/serve/serve.py
@@ -13,16 +13,17 @@ import threading
 import time
 import traceback
 import urllib2
 import uuid
 from collections import defaultdict, OrderedDict
 from multiprocessing import Process, Event
 
 from localpaths import repo_root
+from six.moves import reload_module
 
 from manifest.sourcefile import read_script_metadata, js_meta_re, parse_variants
 from wptserve import server as wptserve, handlers
 from wptserve import stash
 from wptserve import config
 from wptserve.logger import set_logger
 from wptserve.handlers import filesystem_path, wrap_pipeline
 from wptserve.utils import get_port, HTTPException
@@ -562,31 +563,31 @@ class WebSocketDaemon(object):
             self.started = False
         self.server = None
 
 
 def start_ws_server(host, port, paths, routes, bind_address, config, ssl_config,
                     **kwargs):
     # Ensure that when we start this in a new process we don't inherit the
     # global lock in the logging module
-    reload(logging)
+    reload_module(logging)
     return WebSocketDaemon(host,
                            str(port),
                            repo_root,
                            paths["ws_doc_root"],
                            "debug",
                            bind_address,
                            ssl_config = None)
 
 
 def start_wss_server(host, port, paths, routes, bind_address, config, ssl_config,
                      **kwargs):
     # Ensure that when we start this in a new process we don't inherit the
     # global lock in the logging module
-    reload(logging)
+    reload_module(logging)
     return WebSocketDaemon(host,
                            str(port),
                            repo_root,
                            paths["ws_doc_root"],
                            "debug",
                            bind_address,
                            ssl_config)