From d88ec89a67a69534c27b6ccfdfef7cbfd76d5c37 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 13 Dec 2013 14:46:29 -0500 Subject: [PATCH] break out of the while loop after 15 minutes Signed-off-by: Alfredo Deza (cherry picked from commit bef6eb74dcaa37b70b1eab4d28bfa10abb0049d0) Signed-off-by: Zack Cerza --- teuthology/task/ceph-deploy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/teuthology/task/ceph-deploy.py b/teuthology/task/ceph-deploy.py index 7ada79f740..c07aa57ee9 100644 --- a/teuthology/task/ceph-deploy.py +++ b/teuthology/task/ceph-deploy.py @@ -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""" -- 2.39.5