Skip to content

Commit 1d02ce1

Browse files
Group tests for work-stealing by underlying cluster fixture (#1627)
1 parent 9cbf5f6 commit 1d02ce1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/benchmarks/test_work_stealing.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ def test_trivial_workload_should_not_cause_work_stealing(small_client):
2121
small_client.gather(futs)
2222

2323

24+
@run_up_to_nthreads("small_cluster", 100, reason="fixed dataset")
25+
def test_work_stealing_on_inhomogeneous_workload(small_client):
26+
np.random.seed(42)
27+
delays = np.random.lognormal(1, 1.3, 500)
28+
29+
@delayed
30+
def clog(n):
31+
time.sleep(min(n, 60))
32+
return n
33+
34+
results = [clog(i) for i in delays]
35+
futs = small_client.compute(results)
36+
small_client.gather(futs)
37+
38+
2439
@run_up_to_nthreads("small_cluster", 50, reason="fixed dataset")
2540
@pytest.mark.xfail(
2641
Version(distributed.__version__) < Version("2022.6.1"),
@@ -70,21 +85,6 @@ def func2(chunk):
7085
_ = future.result()
7186

7287

73-
@run_up_to_nthreads("small_cluster", 100, reason="fixed dataset")
74-
def test_work_stealing_on_inhomogeneous_workload(small_client):
75-
np.random.seed(42)
76-
delays = np.random.lognormal(1, 1.3, 500)
77-
78-
@delayed
79-
def clog(n):
80-
time.sleep(min(n, 60))
81-
return n
82-
83-
results = [clog(i) for i in delays]
84-
futs = small_client.compute(results)
85-
small_client.gather(futs)
86-
87-
8888
@run_up_to_nthreads("small_cluster", 100, reason="fixed dataset")
8989
def test_work_stealing_on_straggling_worker(
9090
test_name_uuid,

0 commit comments

Comments
 (0)