##// END OF EJS Templates
wait for empty queues as well as tasks...
MinRK -
Show More
@@ -301,9 +301,13 b' class TestClient(ClusterTestCase):'
301 301 self.assertEqual(self.client.hub_history()[-1:],ar.msg_ids)
302 302
303 303 def _wait_for_idle(self):
304 """wait for an engine to become idle, according to the Hub"""
304 """wait for the cluster to become idle, according to the everyone."""
305 305 rc = self.client
306 306
307 # step 0. wait for local results
308 # this should be sufficient 99% of the time.
309 rc.wait(timeout=5)
310
307 311 # step 1. wait for all requests to be noticed
308 312 # timeout 5s, polling every 100ms
309 313 msg_ids = set(rc.history)
@@ -321,7 +325,7 b' class TestClient(ClusterTestCase):'
321 325 # timeout 5s, polling every 100ms
322 326 qs = rc.queue_status()
323 327 for i in range(50):
324 if qs['unassigned'] or any(qs[eid]['tasks'] for eid in rc.ids):
328 if qs['unassigned'] or any(qs[eid]['tasks'] + qs[eid]['queue'] for eid in rc.ids):
325 329 time.sleep(0.1)
326 330 qs = rc.queue_status()
327 331 else:
@@ -331,6 +335,7 b' class TestClient(ClusterTestCase):'
331 335 self.assertEqual(qs['unassigned'], 0)
332 336 for eid in rc.ids:
333 337 self.assertEqual(qs[eid]['tasks'], 0)
338 self.assertEqual(qs[eid]['queue'], 0)
334 339
335 340
336 341 def test_resubmit(self):
General Comments 0
You need to be logged in to leave comments. Login now