From 8284e19226a2f15435974af99bc3d8023e0eac3c Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 29 Jul 2013 12:58:28 -0700 Subject: [PATCH] ceph_manager: wait for all_up in test_map_discontinuity Signed-off-by: Samuel Just --- teuthology/task/ceph_manager.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/teuthology/task/ceph_manager.py b/teuthology/task/ceph_manager.py index 5e27aee9dc80b..13850a32e323a 100644 --- a/teuthology/task/ceph_manager.py +++ b/teuthology/task/ceph_manager.py @@ -211,6 +211,9 @@ class Thrasher: while len(self.in_osds) < (self.minin + 1): self.in_osd() self.log("Waiting for recovery") + self.ceph_manager.wait_for_all_up( + timeout=self.config.get('timeout') + ) self.ceph_manager.wait_for_clean( timeout=self.config.get('timeout') ) @@ -799,6 +802,21 @@ class CephManager: time.sleep(3) self.log("clean!") + def are_all_osds_up(self): + x = self.get_osd_dump() + return (len(x) == \ + sum([(y['up'] > 0) for y in x])) + + def wait_for_all_up(self, timeout=None): + self.log("waiting for all up") + start = time.time() + while not self.are_all_osds_up(): + if timeout is not None: + assert time.time() - start < timeout, \ + 'timeout expired in wait_for_all_up' + time.sleep(3) + self.log("all up!") + def wait_for_recovery(self, timeout=None): self.log("waiting for recovery to complete") start = time.time() -- 2.39.5