From: dparmar18 Date: Tue, 21 Feb 2023 18:08:42 +0000 (+0530) Subject: qa: fix helper function _check_nfs_cluster_status() X-Git-Tag: v19.0.0~1474^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=503f8679ed8ecadf47defbf4bb76abdcab009846;p=ceph-ci.git qa: fix helper function _check_nfs_cluster_status() 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 --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index e8f27a377d0..5effb98b791 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -112,13 +112,12 @@ class TestNFS(MgrTestCase): :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):