From 1cf4d83564a2f5a22f38befc541b81dd23e90c26 Mon Sep 17 00:00:00 2001 From: Gabe Joseph Date: Wed, 20 Jul 2022 15:14:21 -0400 Subject: [PATCH] Remove `test_restart_fast_sync`, `test_fast_kill` These tests were identical, and redundant with tests we already have. The "fast" aspect doesn't make sense to test in CI, restarting processes can actually be very, very slow on some CI workers. --- distributed/tests/test_failed_workers.py | 47 ------------------------ distributed/tests/test_scheduler.py | 4 ++ 2 files changed, 4 insertions(+), 47 deletions(-) diff --git a/distributed/tests/test_failed_workers.py b/distributed/tests/test_failed_workers.py index 754e2916c0c..fc7b202a961 100644 --- a/distributed/tests/test_failed_workers.py +++ b/distributed/tests/test_failed_workers.py @@ -161,22 +161,6 @@ def test_restart_sync(loop): assert y.result() == 1 / 3 -@gen_cluster(Worker=Nanny, client=True, timeout=60) -async def test_restart_fast(c, s, a, b): - L = c.map(sleep, range(10)) - - start = time() - await c.restart() - assert time() - start < 10 - assert len(s.workers) == 2 - - assert all(x.status == "cancelled" for x in L) - - x = c.submit(inc, 1) - result = await x - assert result == 2 - - def test_worker_doesnt_await_task_completion(loop): with cluster(nanny=True, nworkers=1) as (s, [w]): with Client(s["address"], loop=loop) as c: @@ -188,37 +172,6 @@ def test_worker_doesnt_await_task_completion(loop): assert stop - start < 20 -def test_restart_fast_sync(loop): - with cluster(nanny=True) as (s, [a, b]): - with Client(s["address"], loop=loop) as c: - L = c.map(sleep, range(10)) - - start = time() - c.restart() - assert time() - start < 10 - assert len(c.nthreads()) == 2 - - assert all(x.status == "cancelled" for x in L) - - x = c.submit(inc, 1) - assert x.result() == 2 - - -@gen_cluster(Worker=Nanny, client=True, timeout=60) -async def test_fast_kill(c, s, a, b): - L = c.map(sleep, range(10)) - - start = time() - await c.restart() - assert time() - start < 10 - - assert all(x.status == "cancelled" for x in L) - - x = c.submit(inc, 1) - result = await x - assert result == 2 - - @gen_cluster(Worker=Nanny, timeout=60) async def test_multiple_clients_restart(s, a, b): c1 = await Client(s.address, asynchronous=True) diff --git a/distributed/tests/test_scheduler.py b/distributed/tests/test_scheduler.py index a0ee5823dda..437d45e9a83 100644 --- a/distributed/tests/test_scheduler.py +++ b/distributed/tests/test_scheduler.py @@ -628,6 +628,10 @@ async def test_restart(c, s, a, b): assert not s.tasks + assert all(f.status == "cancelled" for f in futures) + x = c.submit(inc, 1) + assert await x == 2 + @pytest.mark.slow @gen_cluster(client=True, Worker=Nanny, nthreads=[("", 1)] * 5)