mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 04:53:01 +00:00
fix race in test_proxy
prevent `.check_routes` from firing while we wait for a new proxy to come up We check explicitly that it comes up with no routes, so makes sure check_routes hasn't restored its state, which is causing intermittent failures
This commit is contained in:
@@ -28,6 +28,9 @@ def test_external_proxy(request):
|
|||||||
cfg.ConfigurableHTTPProxy.should_start = False
|
cfg.ConfigurableHTTPProxy.should_start = False
|
||||||
|
|
||||||
app = MockHub.instance(config=cfg)
|
app = MockHub.instance(config=cfg)
|
||||||
|
# disable last_activity polling to avoid check_routes being called during the test,
|
||||||
|
# which races with some of our test conditions
|
||||||
|
app.last_activity_interval = 0
|
||||||
|
|
||||||
def fin():
|
def fin():
|
||||||
MockHub.clear_instance()
|
MockHub.clear_instance()
|
||||||
@@ -53,10 +56,7 @@ def test_external_proxy(request):
|
|||||||
|
|
||||||
def _cleanup_proxy():
|
def _cleanup_proxy():
|
||||||
if proxy.poll() is None:
|
if proxy.poll() is None:
|
||||||
print("Terminating proxy")
|
|
||||||
proxy.terminate()
|
proxy.terminate()
|
||||||
else:
|
|
||||||
print("Not stopping proxy", proxy)
|
|
||||||
request.addfinalizer(_cleanup_proxy)
|
request.addfinalizer(_cleanup_proxy)
|
||||||
|
|
||||||
def wait_for_proxy():
|
def wait_for_proxy():
|
||||||
|
Reference in New Issue
Block a user