File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
tests/model_serving/model_server/serverless Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 33from typing import Any
44
55from kubernetes .dynamic import DynamicClient
6+ from kubernetes .dynamic .exceptions import ResourceNotFoundError
67from ocp_resources .inference_service import InferenceService
8+ from ocp_resources .utils .constants import DEFAULT_CLUSTER_RETRY_EXCEPTIONS
79from simple_logger .logger import get_logger
810from timeout_sampler import TimeoutSampler
911from timeout_sampler import TimeoutExpiredError
@@ -32,17 +34,20 @@ def verify_no_inference_pods(client: DynamicClient, isvc: InferenceService) -> N
3234 pods = []
3335
3436 try :
35- pods = TimeoutSampler (
37+ for pods in TimeoutSampler (
3638 wait_timeout = Timeout .TIMEOUT_4MIN ,
3739 sleep = 5 ,
40+ exceptions_dict = DEFAULT_CLUSTER_RETRY_EXCEPTIONS ,
3841 func = get_pods_by_isvc_label ,
3942 client = client ,
4043 isvc = isvc ,
41- )
42- if not pods :
43- return
44+ ):
45+ if not pods :
46+ return
4447
45- except TimeoutError :
48+ except TimeoutExpiredError as e :
49+ if type (e .last_exp ) == ResourceNotFoundError :
50+ return
4651 LOGGER .error (f"{ [pod .name for pod in pods ]} were not deleted" )
4752 raise
4853
You can’t perform that action at this time.
0 commit comments