From 7c0eacb780c22969004fe11b844568845c9d9011 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 12 Nov 2019 22:12:53 +0000 Subject: [PATCH] qa/tasks/ceph: healthy: use manager helpers (instead of teuthology/misc ones) Signed-off-by: Sage Weil --- qa/tasks/ceph.py | 15 ++------------- qa/tasks/ceph_manager.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 49818950acd..98eee696cdd 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -1469,14 +1469,7 @@ def healthy(ctx, config): except (run.CommandFailedError, AssertionError) as e: log.info('ignoring mgr wait error, probably testing upgrade: %s', e) - firstmon = teuthology.get_first_mon(ctx, config, cluster_name) - (mon0_remote,) = ctx.cluster.only(firstmon).remotes.keys() - teuthology.wait_until_osds_up( - ctx, - cluster=ctx.cluster, - remote=mon0_remote, - ceph_cluster=cluster_name, - ) + manager.wait_for_all_osds_up(timeout=300) try: manager.flush_all_pg_stats() @@ -1486,11 +1479,7 @@ def healthy(ctx, config): if config.get('wait-for-healthy', True): log.info('Waiting until ceph cluster %s is healthy...', cluster_name) - teuthology.wait_until_healthy( - ctx, - remote=mon0_remote, - ceph_cluster=cluster_name, - ) + manager.wait_until_healthy(timeout=300) if ctx.cluster.only(teuthology.is_type('mds', cluster_name)).remotes: # Some MDSs exist, wait for them to be healthy diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index a8f9ed064aa..029cb9bfdfa 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -2705,6 +2705,16 @@ class CephManager: self.log('health:\n{h}'.format(h=out)) return json.loads(out) + def wait_until_healthy(self, timeout=None): + self.log("wait_until_healthy") + start = time.time() + while self.get_mon_health()['status'] != 'HEALTH_OK': + if timeout is not None: + assert time.time() - start < timeout, \ + 'timeout expired in wait_until_healthy' + time.sleep(3) + self.log("wait_until_healthy done") + def get_filepath(self): """ Return path to osd data with {id} needing to be replaced -- 2.39.5