@@ -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