Skip to content

Commit a6320b7

Browse files
committed
fix: address comments
1 parent 215898f commit a6320b7

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

tests/model_serving/model_server/inference_service_configuration/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def removed_isvc_env_vars(
3232
):
3333
yield ovms_kserve_inference_service
3434

35+
else:
36+
raise ValueError(
37+
f"Inference service {ovms_kserve_inference_service.name} does not have env vars in predictor spec model."
38+
)
39+
3540

3641
@pytest.fixture
3742
def isvc_pods(

utilities/infra.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,22 @@ def wait_for_replicas_in_deployment(deployment: Deployment, replicas: int) -> No
115115
TimeoutExpiredError: If replicas are not updated in spec.
116116
117117
"""
118-
for sample in TimeoutSampler(
119-
wait_timeout=Timeout.TIMEOUT_2MIN,
120-
sleep=1,
121-
func=lambda: deployment.instance,
122-
):
123-
if sample and sample.spec.replicas == replicas:
124-
return
118+
_replicas: int | None = None
119+
120+
try:
121+
for sample in TimeoutSampler(
122+
wait_timeout=Timeout.TIMEOUT_2MIN,
123+
sleep=5,
124+
func=lambda: deployment.instance,
125+
):
126+
if sample and (_replicas := sample.spec.replicas) == replicas:
127+
return
128+
129+
except TimeoutExpiredError:
130+
LOGGER.error(
131+
f"Replicas are not updated in spec.replicas for deployment {deployment.name}.Current replicas: {_replicas}"
132+
)
133+
raise
125134

126135

127136
def wait_for_inference_deployment_replicas(

0 commit comments

Comments
 (0)