]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: use wait_for_health() instead of the new method
authorRishabh Dave <ridave@redhat.com>
Wed, 8 May 2024 12:29:11 +0000 (17:59 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 12 Jul 2024 14:56:24 +0000 (20:26 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 5972cafb7a3750cde83f09c9ac592b97c5f9a9b3)

qa/tasks/cephfs/test_admin.py

index ac2aa8f1c0c365995b13589c33486d1aa992f41d..ee6d30cea645261ce2b0756721eb8cd6b701d9b2 100644 (file)
@@ -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')