mirror of
https://github.com/ceph/ceph
synced 2025-04-26 20:58:57 +00:00
Merge pull request #1036 from david-z/master
Adjust wait_for_health to be more flexible Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
commit
cad11a9612
@ -385,7 +385,7 @@ class CephFSTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def wait_for_health(self, pattern, timeout):
|
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():
|
def seen_health_warning():
|
||||||
health = self.fs.mon_manager.get_mon_health()
|
health = self.fs.mon_manager.get_mon_health()
|
||||||
@ -393,10 +393,13 @@ class CephFSTestCase(unittest.TestCase):
|
|||||||
if len(summary_strings) == 0:
|
if len(summary_strings) == 0:
|
||||||
log.debug("Not expected number of summary strings ({0})".format(summary_strings))
|
log.debug("Not expected number of summary strings ({0})".format(summary_strings))
|
||||||
return False
|
return False
|
||||||
elif len(summary_strings) == 1 and pattern in summary_strings[0]:
|
|
||||||
return True
|
|
||||||
else:
|
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)
|
self.wait_until_true(seen_health_warning, timeout)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user