Skip to content

Commit 5972caf

Browse files
qa/cephfs: use wait_for_health() instead of the new method
Signed-off-by: Rishabh Dave <[email protected]>
1 parent 79b047b commit 5972caf

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

qa/tasks/cephfs/test_admin.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,14 @@ def _get_unhealthy_mds_id(self, health_report, health_warn):
104104
mds_id = mds_id.replace('mds.', '')
105105
return mds_id
106106

107-
def wait_till_health_warn(self, health_warn, active_mds_id, sleep=3,
108-
tries=10):
109-
errmsg = (f'Expected health warning "{health_warn}" to eventually '
110-
'show up in output of command "ceph health detail". Tried '
111-
f'{tries} times with interval of {sleep} seconds but the '
112-
'health warning didn\'t turn up.')
113-
114-
with safe_while(sleep=sleep, tries=tries, action=errmsg) as proceed:
115-
while proceed():
116-
self.get_ceph_cmd_stdout(
117-
f'tell mds.{active_mds_id} cache status')
118-
119-
health_report = json.loads(self.get_ceph_cmd_stdout(
120-
'health detail --format json'))
121-
122-
if health_warn in health_report['checks']:
123-
return
124-
125107
def gen_health_warn_mds_cache_oversized(self):
126108
health_warn = 'MDS_CACHE_OVERSIZED'
127109

128110
self.config_set('mds', 'mds_cache_memory_limit', '1K')
129111
self.config_set('mds', 'mds_health_cache_threshold', '1.00000')
130112
self.mount_a.open_n_background('.', 400)
131113

132-
self.wait_till_health_warn(health_warn, active_mds_id)
114+
self.wait_for_health(health_warn, 30)
133115

134116
def gen_health_warn_mds_trim(self):
135117
health_warn = 'MDS_TRIM'
@@ -142,7 +124,7 @@ def gen_health_warn_mds_trim(self):
142124
self.config_set('mds', 'mds_log_trim_threshold', '1')
143125
self.mount_a.open_n_background('.', 400)
144126

145-
self.wait_till_health_warn(health_warn, active_mds_id)
127+
self.wait_for_health(health_warn, 30)
146128

147129

148130
@classhook('_add_valid_tell')

0 commit comments

Comments
 (0)