diff --git a/distributed/cli/tests/test_dask_worker.py b/distributed/cli/tests/test_dask_worker.py index 771dd6d2af..c0e86dd67c 100644 --- a/distributed/cli/tests/test_dask_worker.py +++ b/distributed/cli/tests/test_dask_worker.py @@ -493,9 +493,9 @@ def test_dashboard_non_standard_ports(): # use internal ip instead of localhost ip to verify GlobalProxyHandler will update # to allow internal host ip of a worker. w_host = get_ip() - s_port = "3233" - s_dashboard_port = "3232" - w_dashboard_port = "4833" + s_port = open_port(s_host) + s_dashboard_port = open_port(s_host) + w_dashboard_port = open_port(w_host) s_cmd = f"dask scheduler --host {s_host} --port {s_port} --dashboard-address :{s_dashboard_port}" w_cmd = f"dask worker {s_host}:{s_port} --dashboard-address :{w_dashboard_port} --host {w_host}" diff --git a/distributed/tests/test_jupyter.py b/distributed/tests/test_jupyter.py index 52ca25c169..5280d11093 100644 --- a/distributed/tests/test_jupyter.py +++ b/distributed/tests/test_jupyter.py @@ -113,7 +113,7 @@ async def test_jupyter_idle_timeout_returned(): @pytest.mark.slow @pytest.mark.xfail(WINDOWS, reason="Subprocess launching scheduler TimeoutError") @pytest.mark.xfail(MACOS, reason="Client fails to connect on OSX") -def test_shutsdown_cleanly(loop): +def test_shutsdown_cleanly(requires_default_ports): port = open_port() with concurrent.futures.ThreadPoolExecutor() as tpe: subprocess_fut = tpe.submit( @@ -133,7 +133,7 @@ def test_shutsdown_cleanly(loop): ) # wait until scheduler is running - with Client(f"127.0.0.1:{port}", loop=loop): + with Client(f"127.0.0.1:{port}"): pass with requests.Session() as session: