def is_clean(self):
return self.get_num_active_clean() == self.get_num_pgs()
- def wait_till_clean(self):
+ def wait_till_clean(self, timeout=None):
self.log("waiting till clean")
+ start = time.time()
while not self.is_clean():
+ if timeout is not None:
+ assert time.time() - start < timeout, \
+ 'failed to become clean before timeout expired'
time.sleep(3)
self.log("clean!")
wrongly marked down will mark itself back up again.) This value
can be either an integer (eg, 75) or a float probability (eg
0.75).
-
+
+ timeout: (360) the number of seconds to wait for the cluster
+ to become clean before the task exits. If this doesn't happen,
+ an exception will be raised.
+
example:
tasks:
chance_down: 10
op_delay: 3
min_in: 1
+ timeout: 600
- interactive:
"""
log.info('Beginning thrashosds...')
finally:
log.info('joining thrashosds')
thrash_proc.do_join()
- manager.wait_till_clean()
+ manager.wait_till_clean(config.get('timeout', 360))