From: Rishabh Dave Date: Wed, 8 May 2024 12:29:11 +0000 (+0530) Subject: qa/cephfs: use wait_for_health() instead of the new method X-Git-Tag: v20.0.0~1549^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5972cafb7a3750cde83f09c9ac592b97c5f9a9b3;p=ceph.git qa/cephfs: use wait_for_health() instead of the new method Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index 93ebe1a7c2b..2c2c6d03325 100644 --- a/qa/tasks/cephfs/test_admin.py +++ b/qa/tasks/cephfs/test_admin.py @@ -104,24 +104,6 @@ class TestAdminCommands(CephFSTestCase): mds_id = mds_id.replace('mds.', '') return mds_id - def wait_till_health_warn(self, health_warn, active_mds_id, sleep=3, - tries=10): - errmsg = (f'Expected health warning "{health_warn}" to eventually ' - 'show up in output of command "ceph health detail". Tried ' - f'{tries} times with interval of {sleep} seconds but the ' - 'health warning didn\'t turn up.') - - with safe_while(sleep=sleep, tries=tries, action=errmsg) as proceed: - while proceed(): - self.get_ceph_cmd_stdout( - f'tell mds.{active_mds_id} cache status') - - health_report = json.loads(self.get_ceph_cmd_stdout( - 'health detail --format json')) - - if health_warn in health_report['checks']: - return - def gen_health_warn_mds_cache_oversized(self): health_warn = 'MDS_CACHE_OVERSIZED' @@ -129,7 +111,7 @@ class TestAdminCommands(CephFSTestCase): self.config_set('mds', 'mds_health_cache_threshold', '1.00000') self.mount_a.open_n_background('.', 400) - self.wait_till_health_warn(health_warn, active_mds_id) + self.wait_for_health(health_warn, 30) def gen_health_warn_mds_trim(self): health_warn = 'MDS_TRIM' @@ -142,7 +124,7 @@ class TestAdminCommands(CephFSTestCase): self.config_set('mds', 'mds_log_trim_threshold', '1') self.mount_a.open_n_background('.', 400) - self.wait_till_health_warn(health_warn, active_mds_id) + self.wait_for_health(health_warn, 30) @classhook('_add_valid_tell')