Skip to content

Commit 4a05368

Browse files
committed
More robust test
1 parent 008d66a commit 4a05368

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

distributed/tests/test_cancelled_state.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,15 @@ def blockable_compute(x, lock):
158158
allow_other_workers=True,
159159
key="fut1",
160160
)
161+
await wait(fut1)
162+
await block_compute.acquire()
161163
fut2 = c.submit(inc, fut1, workers=[b.address], key="fut2")
162164

163165
await enter_get_data.wait()
164-
await block_compute.acquire()
165166

166167
# Close in scheduler to ensure we transition and reschedule task properly
167-
s.close_worker(worker=a.address)
168-
await wait_for_state(fut1.key, "resumed", b, interval=0)
168+
await s.remove_worker(a.address, stimulus_id="test", close=False)
169+
await wait_for_stimulus(ComputeTaskEvent, b, key=fut1.key)
169170

170171
block_get_data.release()
171172
await block_compute.release()

0 commit comments

Comments
 (0)