Skip to content

Commit bb5a754

Browse files
authored
Fix E2E tests (#2377)
1 parent 2f71b5f commit bb5a754

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

test/e2e/e2e/tests.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from e2e.utils import (
3737
apis_ready,
3838
api_updated,
39-
api_requests,
4039
wait_on_event,
4140
wait_on_futures,
4241
endpoint_ready,
@@ -845,7 +844,6 @@ def test_long_running_realtime(
845844
assert len(api_specs) == 1
846845

847846
time_to_run = long_running_config["time_to_run"]
848-
status_code_timeout = long_running_config["status_code_timeout"]
849847

850848
if len(node_groups) > 0:
851849
api_specs[0]["node_groups"] = node_groups
@@ -881,11 +879,6 @@ def test_long_running_realtime(
881879

882880
counter += 1
883881

884-
printer("verifying number of processed requests using the client")
885-
assert api_requests(
886-
client, api_name, counter, timeout=status_code_timeout
887-
), f"the number of 2xx response codes for api {api_name} doesn't match the expected number {counter}"
888-
889882
except:
890883
# best effort
891884
try:

test/e2e/e2e/utils.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,19 @@ def wait_for(fn: Callable[[], bool], timeout=None) -> bool:
3838

3939

4040
def apis_ready(client: cx.Client, api_names: List[str], timeout: Optional[int] = None) -> bool:
41+
def _check_liveness(status):
42+
return status["requested"] == status["ready"] == status["up_to_date"]
43+
4144
def _is_ready():
42-
return all(
43-
[client.get_api(name)["status"]["status_code"] == "status_live" for name in api_names]
44-
)
45+
return all([_check_liveness(client.get_api(name)["status"]) for name in api_names])
4546

4647
return wait_for(_is_ready, timeout=timeout)
4748

4849

4950
def api_updated(client: cx.Client, api_name: str, timeout: Optional[int] = None) -> bool:
5051
def _is_ready():
5152
status = client.get_api(api_name)["status"]
52-
return status["replica_counts"]["requested"] == status["replica_counts"]["updated"]["ready"]
53-
54-
return wait_for(_is_ready, timeout=timeout)
55-
56-
57-
def api_requests(
58-
client: cx.Client, api_name: str, target_requests: int, timeout: Optional[int] = None
59-
) -> bool:
60-
def _is_ready():
61-
return client.get_api(api_name)["metrics"]["network_stats"]["code_2xx"] == target_requests
53+
return status["requested"] == status["ready"]
6254

6355
return wait_for(_is_ready, timeout=timeout)
6456

0 commit comments

Comments
 (0)