Show More
@@ -301,9 +301,13 b' class TestClient(ClusterTestCase):' | |||||
301 | self.assertEqual(self.client.hub_history()[-1:],ar.msg_ids) |
|
301 | self.assertEqual(self.client.hub_history()[-1:],ar.msg_ids) | |
302 |
|
302 | |||
303 | def _wait_for_idle(self): |
|
303 | def _wait_for_idle(self): | |
304 |
"""wait for |
|
304 | """wait for the cluster to become idle, according to the everyone.""" | |
305 | rc = self.client |
|
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 | # step 1. wait for all requests to be noticed |
|
311 | # step 1. wait for all requests to be noticed | |
308 | # timeout 5s, polling every 100ms |
|
312 | # timeout 5s, polling every 100ms | |
309 | msg_ids = set(rc.history) |
|
313 | msg_ids = set(rc.history) | |
@@ -321,7 +325,7 b' class TestClient(ClusterTestCase):' | |||||
321 | # timeout 5s, polling every 100ms |
|
325 | # timeout 5s, polling every 100ms | |
322 | qs = rc.queue_status() |
|
326 | qs = rc.queue_status() | |
323 | for i in range(50): |
|
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 | time.sleep(0.1) |
|
329 | time.sleep(0.1) | |
326 | qs = rc.queue_status() |
|
330 | qs = rc.queue_status() | |
327 | else: |
|
331 | else: | |
@@ -331,6 +335,7 b' class TestClient(ClusterTestCase):' | |||||
331 | self.assertEqual(qs['unassigned'], 0) |
|
335 | self.assertEqual(qs['unassigned'], 0) | |
332 | for eid in rc.ids: |
|
336 | for eid in rc.ids: | |
333 | self.assertEqual(qs[eid]['tasks'], 0) |
|
337 | self.assertEqual(qs[eid]['tasks'], 0) | |
|
338 | self.assertEqual(qs[eid]['queue'], 0) | |||
334 |
|
339 | |||
335 |
|
340 | |||
336 | def test_resubmit(self): |
|
341 | def test_resubmit(self): |
General Comments 0
You need to be logged in to leave comments.
Login now