Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions test/e2e/e2e/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions test/e2e/e2e/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
)

Expand Down