Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check pod readiness in ingress scale test #5774

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
NS_COUNT,
NUM_REPLICAS,
)
from suite.utils.resources_utils import get_first_pod_name
from suite.utils.resources_utils import get_first_pod_name, wait_until_all_pods_are_ready


def pytest_addoption(parser) -> None:
Expand Down Expand Up @@ -200,6 +200,7 @@ def pytest_runtest_makereport(item) -> None:
pod_namespace = item.funcargs["ingress_controller_prerequisites"].namespace
pod_name = get_first_pod_name(item.funcargs["kube_apis"].v1, pod_namespace)
print("\n===================== IC Logs Start =====================")
wait_until_all_pods_are_ready(item.funcargs["kube_apis"].v1, pod_namespace)
print(item.funcargs["kube_apis"].v1.read_namespaced_pod_log(pod_name, pod_namespace))
print("\n===================== IC Logs End =====================")

Expand Down
27 changes: 16 additions & 11 deletions tests/suite/test_rl_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from suite.fixtures.fixtures import PublicEndpoint
from suite.utils.custom_assertions import assert_event_count_increased
from suite.utils.resources_utils import (
are_all_pods_in_ready_state,
create_example_app,
create_items_from_yaml,
delete_common_app,
Expand Down Expand Up @@ -129,14 +130,18 @@ def test_ingress_rate_limit_sscaled(
"""
ns = ingress_controller_prerequisites.namespace
scale_deployment(kube_apis.v1, kube_apis.apps_v1_api, "nginx-ingress", ns, 4)
ic_pods = get_pod_list(kube_apis.v1, ns)
for i in range(len(ic_pods)):
conf = get_ingress_nginx_template_conf(
kube_apis.v1,
annotations_setup.namespace,
annotations_setup.ingress_name,
ic_pods[i].metadata.name,
ingress_controller_prerequisites.namespace,
)
flag = ("rate=10r/s" in conf) or ("rate=13r/s" in conf)
assert flag
wait_before_test()
if are_all_pods_in_ready_state(kube_apis.v1, ns):
ic_pods = get_pod_list(kube_apis.v1, ns)
for i in range(len(ic_pods)):
conf = get_ingress_nginx_template_conf(
kube_apis.v1,
annotations_setup.namespace,
annotations_setup.ingress_name,
ic_pods[i].metadata.name,
ingress_controller_prerequisites.namespace,
)
flag = ("rate=10r/s" in conf) or ("rate=13r/s" in conf)
assert flag
else:
assert False, "Pods are not in ready state"
Loading