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 11from typing import Any
22
33from kubernetes .dynamic import DynamicClient
4+ from kubernetes .dynamic .exceptions import ResourceNotFoundError
45from ocp_resources .inference_service import InferenceService
6+ from ocp_resources .utils .constants import DEFAULT_CLUSTER_RETRY_EXCEPTIONS
57from simple_logger .logger import get_logger
68from timeout_sampler import TimeoutSampler
79from timeout_sampler import TimeoutExpiredError
@@ -30,17 +32,20 @@ def verify_no_inference_pods(client: DynamicClient, isvc: InferenceService) -> N
3032 pods = []
3133
3234 try :
33- pods = TimeoutSampler (
35+ for pods in TimeoutSampler (
3436 wait_timeout = Timeout .TIMEOUT_4MIN ,
3537 sleep = 5 ,
38+ exceptions_dict = DEFAULT_CLUSTER_RETRY_EXCEPTIONS ,
3639 func = get_pods_by_isvc_label ,
3740 client = client ,
3841 isvc = isvc ,
39- )
40- if not pods :
41- return
42+ ):
43+ if not pods :
44+ return
4245
43- except TimeoutError :
46+ except TimeoutExpiredError as e :
47+ if isinstance (e .last_exp , ResourceNotFoundError ):
48+ return
4449 LOGGER .error (f"{ [pod .name for pod in pods ]} were not deleted" )
4550 raise
4651
You can’t perform that action at this time.
0 commit comments