From 1b7991e92e1bf9176fff52c604d32aa817b3dd5c Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Tue, 22 Mar 2016 11:20:24 +0100 Subject: [PATCH] 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 --- src/test/ceph_objectstore_tool.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 -- 2.47.3