]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: Reducing sleep loops in ceph_objectstore_tool
authorErwan Velu <erwan@redhat.com>
Tue, 22 Mar 2016 10:20:24 +0000 (11:20 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:25 +0000 (09:36 +0200)
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 <erwan@redhat.com>
src/test/ceph_objectstore_tool.py

index 789aae4adc72079725ace195f2d252bea8d892e0..454bf845f281a67bd3668ab7d209b5a66305302f 100755 (executable)
@@ -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