Skip to content

Commit 564dab0

Browse files
committed
Lose references to futures
1 parent fb31922 commit 564dab0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/stability/test_adaptive_scaling.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from dask import delayed
88
from dask.distributed import Client, Event, Semaphore, wait
99

10-
TIMEOUT_THRESHOLD = 600 # 10 minutes
10+
TIMEOUT_THRESHOLD = 1800 # 10 minutes
1111

1212

1313
@pytest.mark.stability
@@ -80,23 +80,23 @@ def clog(x: int, ev: Event, sem: Semaphore, **kwargs) -> int:
8080
sem_fan_out = Semaphore(name="fan-out", max_leases=fan_out_size)
8181
ev_fan_out = Event(name="fan-out", client=client)
8282

83-
fan_out = client.map(
83+
fut = client.map(
8484
clog, range(fan_out_size), ev=ev_fan_out, sem=sem_fan_out
8585
)
8686

87-
reduction = client.submit(sum, fan_out)
87+
fut = client.submit(sum, fut)
8888
sem_barrier = Semaphore(name="barrier", max_leases=1)
8989
ev_barrier = Event(name="barrier", client=client)
90-
barrier = client.submit(clog, reduction, ev=ev_barrier, sem=sem_barrier)
90+
fut = client.submit(clog, fut, ev=ev_barrier, sem=sem_barrier)
9191

9292
sem_final_fan_out = Semaphore(name="final-fan-out", max_leases=fan_out_size)
9393
ev_final_fan_out = Event(name="final-fan-out", client=client)
94-
final_fan_out = client.map(
94+
fut = client.map(
9595
clog,
9696
range(fan_out_size),
9797
ev=ev_final_fan_out,
9898
sem=sem_final_fan_out,
99-
barrier=barrier,
99+
barrier=fut,
100100
)
101101

102102
# Scale up to maximum
@@ -132,7 +132,8 @@ def clog(x: int, ev: Event, sem: Semaphore, **kwargs) -> int:
132132
assert adapt.log[-1][1]["status"] == "up"
133133

134134
ev_final_fan_out.set()
135-
client.gather(final_fan_out)
135+
client.gather(fut)
136+
del fut
136137

137138
# Scale down to minimum
138139
start = time.monotonic()

0 commit comments

Comments
 (0)