Skip to content

Commit 061bcb1

Browse files
authored
Merge pull request #546 from minrk/relax-notice-stop
more robust wait in test_cluster_manager_notice_stop
2 parents 1bf985e + 7172a78 commit 061bcb1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ipyparallel/tests/test_cluster.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,12 @@ async def test_cluster_manager_notice_stop(Cluster):
322322
c_copy = cm.clusters[key]
323323

324324
await c.stop_cluster()
325-
# give it a moment to notice
326-
time.sleep(5)
325+
327326
# refresh list, cleans out stopped clusters
328-
cm.load_clusters()
327+
# can take some time to notice
328+
tic = time.perf_counter()
329+
deadline = time.perf_counter() + 30
330+
while time.perf_counter() < deadline and key in cm.clusters:
331+
time.sleep(0.2)
332+
cm.load_clusters()
329333
assert key not in cm.clusters

0 commit comments

Comments
 (0)