From afc968146d2d043eed45bee475cc1287ef9fdd5c Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 27 Jul 2017 11:52:45 +0200 Subject: [PATCH] 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 --- jupyterhub/tests/test_proxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jupyterhub/tests/test_proxy.py b/jupyterhub/tests/test_proxy.py index 0f6334db..134434b8 100644 --- a/jupyterhub/tests/test_proxy.py +++ b/jupyterhub/tests/test_proxy.py @@ -28,6 +28,9 @@ def test_external_proxy(request): cfg.ConfigurableHTTPProxy.should_start = False 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(): MockHub.clear_instance() @@ -53,10 +56,7 @@ def test_external_proxy(request): def _cleanup_proxy(): if proxy.poll() is None: - print("Terminating proxy") proxy.terminate() - else: - print("Not stopping proxy", proxy) request.addfinalizer(_cleanup_proxy) def wait_for_proxy():