From: Erwan Velu Date: Tue, 22 Mar 2016 10:20:24 +0000 (+0100) Subject: tests: Reducing sleep loops in ceph_objectstore_tool X-Git-Tag: v10.1.1~3^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1b7991e92e1bf9176fff52c604d32aa817b3dd5c;p=ceph.git tests: Reducing sleep loops in ceph_objectstore_tool This python script is making excessive sleep calls while running some ceph commands. Waiting up to 5 seconds to get the proper health status can be shorten to avoid the worst case of waiting almost 5 seconds for nothing. This patch removes also two sleeps calls after a wait_for_health call which is already supposed to provides a clean state. Waiting respectively 20 & 15 seconds after that call is just loosing time which is precious at make check time. Signed-off-by: Erwan Velu --- diff --git a/src/test/ceph_objectstore_tool.py b/src/test/ceph_objectstore_tool.py index 789aae4adc72..454bf845f281 100755 --- a/src/test/ceph_objectstore_tool.py +++ b/src/test/ceph_objectstore_tool.py @@ -44,9 +44,9 @@ def wait_for_health(): print "Wait for health_ok...", tries = 0 while call("./ceph health 2> /dev/null | grep -v 'HEALTH_OK\|HEALTH_WARN' > /dev/null", shell=True) == 0: - if ++tries == 30: + if ++tries == 150: raise Exception("Time exceeded to go to health") - time.sleep(5) + time.sleep(1) print "DONE" @@ -1799,16 +1799,12 @@ def main(argv): vstart(new=False) wait_for_health() - time.sleep(20) - cmd = "./ceph osd pool set {pool} pg_num 2".format(pool=SPLIT_POOL) logging.debug(cmd) ret = call(cmd, shell=True, stdout=nullfd, stderr=nullfd) time.sleep(5) wait_for_health() - time.sleep(15) - kill_daemons() # Now 2 PGs, poolid.0 and poolid.1