]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
break out of the while loop after 15 minutes
authorAlfredo Deza <alfredo.deza@inktank.com>
Fri, 13 Dec 2013 19:46:29 +0000 (14:46 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 2 Jan 2014 20:48:49 +0000 (14:48 -0600)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
(cherry picked from commit bef6eb74dcaa37b70b1eab4d28bfa10abb0049d0)
Signed-off-by: Zack Cerza <zack@cerza.org>
teuthology/task/ceph-deploy.py

index 7ada79f7402aeda0e60777e509d4d7aab7f7dd16..c07aa57ee94ecc9b6a1b0de71ede6aa882af7ea7 100644 (file)
@@ -66,7 +66,14 @@ def is_healthy(ctx, config):
     testdir = teuthology.get_testdir(ctx)
     ceph_admin = teuthology.get_first_mon(ctx, config)
     (remote,) = ctx.cluster.only(ceph_admin).remotes.keys()
+    max_tries = 90  # 90 tries * 10 secs --> 15 minutes
+    tries = 0
     while True:
+        tries += 1
+        if tries >= max_tries:
+            msg = "ceph health was unable to get 'HEALTH_OK' after waiting 15 minutes"
+            raise RuntimeError(msg)
+
         r = remote.run(
             args=[
                 'cd',
@@ -82,7 +89,7 @@ def is_healthy(ctx, config):
         log.debug('Ceph health: %s', out.rstrip('\n'))
         if out.split(None, 1)[0] == 'HEALTH_OK':
             break
-        time.sleep(1)
+        time.sleep(10)
 
 def get_nodes_using_roles(ctx, config, role):
     """Extract the names of nodes that match a given role from a cluster"""