From 698fb2d60392ad15b511ea2e46c62bf6b06b1539 Mon Sep 17 00:00:00 2001 From: Hendrik Makait Date: Fri, 13 Dec 2024 16:36:55 +0100 Subject: [PATCH] Pick random dashboard port in tests (#8965) --- distributed/tests/test_preload.py | 2 +- distributed/tests/test_scheduler.py | 2 +- distributed/tests/test_utils_test.py | 4 ++-- distributed/tests/test_worker.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/distributed/tests/test_preload.py b/distributed/tests/test_preload.py index 1d9279b5242..c0dcbc2f940 100644 --- a/distributed/tests/test_preload.py +++ b/distributed/tests/test_preload.py @@ -238,7 +238,7 @@ async def test_web_preload_worker(): "urllib3.PoolManager.request", **{"return_value.data": data}, ) as request: - async with Scheduler(port=port, host="localhost") as s: + async with Scheduler(port=port, host="localhost", dashboard_address=":0") as s: async with Nanny(preload_nanny=["http://example.com/preload"]) as nanny: assert nanny.scheduler_addr == s.address assert request.mock_calls == [ diff --git a/distributed/tests/test_scheduler.py b/distributed/tests/test_scheduler.py index 92a83c35631..ac77936d75e 100644 --- a/distributed/tests/test_scheduler.py +++ b/distributed/tests/test_scheduler.py @@ -4523,7 +4523,7 @@ def test_runspec_regression_sync(loop): # https://github.com/dask/distributed/issues/6624 np = pytest.importorskip("numpy") da = pytest.importorskip("dask.array") - with Client(loop=loop): + with Client(loop=loop, dashboard_address=":0"): v = da.random.random((20, 20), chunks=(5, 5)) overlapped = da.map_overlap(np.sum, v, depth=2, boundary="reflect") diff --git a/distributed/tests/test_utils_test.py b/distributed/tests/test_utils_test.py index 6718060f7c2..7b288d92ef6 100755 --- a/distributed/tests/test_utils_test.py +++ b/distributed/tests/test_utils_test.py @@ -1008,9 +1008,9 @@ def test_sizeof_error(input, exc, msg): @gen_test() async def test_ensure_no_new_clients(): with ensure_no_new_clients(): - async with Scheduler() as s: + async with Scheduler(dashboard_address=":0") as s: pass - async with Scheduler() as s: + async with Scheduler(dashboard_address=":0") as s: with ensure_no_new_clients(): pass with pytest.raises(AssertionError): diff --git a/distributed/tests/test_worker.py b/distributed/tests/test_worker.py index 404e6817e6b..bed1a9dec63 100644 --- a/distributed/tests/test_worker.py +++ b/distributed/tests/test_worker.py @@ -505,7 +505,7 @@ def setup(self, worker=None): @gen_test() async def test_plugin_internal_exception(): - async with Scheduler(port=0) as s: + async with Scheduler(port=0, dashboard_address=":0") as s: with raises_with_cause( RuntimeError, "Worker failed to start",