From c92f65271d2728dabca949d0f1c970cb1e76e735 Mon Sep 17 00:00:00 2001 From: Yang Chiu Date: Thu, 4 Jan 2024 16:43:18 +0800 Subject: [PATCH] test: fix flaky test case test_recovery_from_im_deletion Signed-off-by: Yang Chiu --- manager/integration/tests/common.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/manager/integration/tests/common.py b/manager/integration/tests/common.py index cb27f794a7..bbfbda2c4f 100644 --- a/manager/integration/tests/common.py +++ b/manager/integration/tests/common.py @@ -529,11 +529,14 @@ def wait_pod(pod_name): pod = None for i in range(DEFAULT_POD_TIMEOUT): - pod = api.read_namespaced_pod( - name=pod_name, - namespace='default') - if pod is not None and pod.status.phase != 'Pending': - break + try: + pod = api.read_namespaced_pod( + name=pod_name, + namespace='default') + if pod is not None and pod.status.phase != 'Pending': + break + except Exception as e: + print(f"Waiting for pod {pod_name} failed: {e}") time.sleep(DEFAULT_POD_INTERVAL) assert pod is not None and pod.status.phase == 'Running'