Comment in the code says to wait for two minutes as cluster
creation takes time but actually it's waiting for thirteen
minutes, it's not required to wait this long, i think a minute
here is more than enough, also switched to using safe_while().
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
:param expected_status: Status to be verified
:param fail_msg: Message to be printed if test failed
'''
- # Wait for two minutes as ganesha daemon takes some time to be deleted/created
- wait_time = 10
- while wait_time <= 120:
- time.sleep(wait_time)
- if expected_status in self._fetch_nfs_daemons_details():
- return
- wait_time += 10
+ # Wait for a minute as ganesha daemon takes some time to be
+ # deleted/created
+ with contextutil.safe_while(sleep=6, tries=10, _raise=False) as proceed:
+ while proceed():
+ if expected_status in self._fetch_nfs_daemons_details():
+ return
self.fail(fail_msg)
def _check_auth_ls(self, export_id=1, check_in=False):