From: Zhi Zhang Date: Mon, 6 Jun 2016 05:01:27 +0000 (+0800) Subject: Adjust wait_for_health to be more flexsible X-Git-Tag: v11.1.1~58^2^2~171^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f83db056d8eefe98c8eca66a6a1d66f0463c7dc2;p=ceph.git Adjust wait_for_health to be more flexsible Signed-off-by: Zhi Zhang --- diff --git a/tasks/cephfs/cephfs_test_case.py b/tasks/cephfs/cephfs_test_case.py index 1d8ce13e953..29855d90d5a 100644 --- a/tasks/cephfs/cephfs_test_case.py +++ b/tasks/cephfs/cephfs_test_case.py @@ -385,7 +385,7 @@ class CephFSTestCase(unittest.TestCase): def wait_for_health(self, pattern, timeout): """ - Wait until 'ceph health' contains a single message matching the pattern + Wait until 'ceph health' contains messages matching the pattern """ def seen_health_warning(): health = self.fs.mon_manager.get_mon_health() @@ -393,10 +393,13 @@ class CephFSTestCase(unittest.TestCase): if len(summary_strings) == 0: log.debug("Not expected number of summary strings ({0})".format(summary_strings)) return False - elif len(summary_strings) == 1 and pattern in summary_strings[0]: - return True else: - raise RuntimeError("Unexpected health messages: {0}".format(summary_strings)) + for ss in summary_strings: + if pattern in ss: + return True + + log.debug("Not found expected summary strings yet ({0})".format(summary_strings)) + return False self.wait_until_true(seen_health_warning, timeout)