diff --git a/test/e2e/e2e/tests.py b/test/e2e/e2e/tests.py index 59a5c65e24..3f1fe51f3d 100644 --- a/test/e2e/e2e/tests.py +++ b/test/e2e/e2e/tests.py @@ -476,9 +476,7 @@ def test_autoscaling( assert api_updated( client, primary_api_name, timeout=deploy_timeout ), "api didn't scale up to the desired number of replicas in time" - current_replicas = client.get_api(primary_api_name)["status"]["replica_counts"][ - "requested" - ] + current_replicas = client.get_api(primary_api_name)["status"]["requested"] # stop the requests from being made if current_replicas == max_replicas and not request_stopper.is_set(): @@ -908,7 +906,7 @@ def test_realtime_scale_to_zero( try: assert apis_ready( - client=client, api_names=[api_name], timeout=timeout + client=client, api_names=[api_name], timeout=timeout, greater_or_equal_to=0 ), f"apis {api_name} not ready" api_info = client.get_api(api_name) diff --git a/test/e2e/e2e/utils.py b/test/e2e/e2e/utils.py index 1060eeca73..296f516ffd 100644 --- a/test/e2e/e2e/utils.py +++ b/test/e2e/e2e/utils.py @@ -37,10 +37,15 @@ def wait_for(fn: Callable[[], bool], timeout=None) -> bool: time.sleep(1) -def apis_ready(client: cx.Client, api_names: List[str], timeout: Optional[int] = None) -> bool: +def apis_ready( + client: cx.Client, + api_names: List[str], + timeout: Optional[int] = None, + greater_or_equal_to: int = 1, +) -> bool: def _check_liveness(status): return ( - status["requested"] > 0 + status["requested"] >= greater_or_equal_to and status["requested"] == status["ready"] == status["up_to_date"] )