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>
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"
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