From 75f4635b05034eba890c90d2f829c3672f59e017 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 5 Jul 2022 16:46:54 +0100 Subject: [PATCH] use the loop fixture in even more tests (#6674) --- distributed/cli/tests/test_dask_worker.py | 4 ++-- distributed/deploy/tests/test_adaptive.py | 2 +- distributed/tests/test_client.py | 1 + distributed/tests/test_scheduler.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/distributed/cli/tests/test_dask_worker.py b/distributed/cli/tests/test_dask_worker.py index c6605660110..21b6003eb59 100644 --- a/distributed/cli/tests/test_dask_worker.py +++ b/distributed/cli/tests/test_dask_worker.py @@ -703,7 +703,7 @@ async def test_signal_handling(c, s, nanny, sig): @pytest.mark.parametrize("nanny", ["--nanny", "--no-nanny"]) -def test_error_during_startup(monkeypatch, nanny): +def test_error_during_startup(monkeypatch, nanny, loop): # see https://github.com/dask/distributed/issues/6320 scheduler_port = open_port() scheduler_addr = f"tcp://127.0.0.1:{scheduler_port}" @@ -716,7 +716,7 @@ def test_error_during_startup(monkeypatch, nanny): "--dashboard-address=:0", ], ): - with Client(scheduler_addr) as c: + with Client(scheduler_addr, loop=loop) as c: with popen( [ "dask-worker", diff --git a/distributed/deploy/tests/test_adaptive.py b/distributed/deploy/tests/test_adaptive.py index 644fae6deb3..2712b12be78 100644 --- a/distributed/deploy/tests/test_adaptive.py +++ b/distributed/deploy/tests/test_adaptive.py @@ -293,7 +293,7 @@ def test_basic_no_loop(cleanup): loop = None try: with LocalCluster( - n_workers=0, silence_logs=False, dashboard_address=":0" + n_workers=0, silence_logs=False, dashboard_address=":0", loop=None ) as cluster: with Client(cluster) as client: cluster.adapt() diff --git a/distributed/tests/test_client.py b/distributed/tests/test_client.py index 98a53a8e654..c8c849eea79 100644 --- a/distributed/tests/test_client.py +++ b/distributed/tests/test_client.py @@ -6854,6 +6854,7 @@ def f(x): processes=False, dashboard_address=":0", worker_dashboard_address=":0", + loop=None, ) as cluster2: with Client(cluster2) as c1: c2 = get_client() diff --git a/distributed/tests/test_scheduler.py b/distributed/tests/test_scheduler.py index 34f3a610175..9ea5a0bc7c1 100644 --- a/distributed/tests/test_scheduler.py +++ b/distributed/tests/test_scheduler.py @@ -3600,12 +3600,12 @@ async def test_scheduler_close_fast_deprecated(s, w): await s.close(fast=True) -def test_runspec_regression_sync(): +def test_runspec_regression_sync(loop): # https://github.com/dask/distributed/issues/6624 da = pytest.importorskip("dask.array") np = pytest.importorskip("numpy") - with Client(): + with Client(loop=loop): v = da.random.random((20, 20), chunks=(5, 5)) overlapped = da.map_overlap(np.sum, v, depth=2, boundary="reflect")