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

Add wait in scaled rate-limit test #6940

Merged
merged 1 commit into from
Dec 9, 2024
Merged
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
28 changes: 17 additions & 11 deletions tests/suite/test_rl_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_ingress_rate_limit(self, kube_apis, annotations_setup, ingress_controll
@pytest.mark.annotations
@pytest.mark.parametrize("annotations_setup", ["standard-scaled", "mergeable-scaled"], indirect=True)
class TestRateLimitIngressScaled:
def test_ingress_rate_limit_sscaled(
def test_ingress_rate_limit_scaled(
self, kube_apis, annotations_setup, ingress_controller_prerequisites, test_namespace
):
"""
Expand All @@ -133,14 +133,20 @@ def test_ingress_rate_limit_sscaled(
wait_before_test()

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
flag = False
retries = 0
while flag is False and retries < 10:
retries += 1
wait_before_test()
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
scale_deployment(kube_apis.v1, kube_apis.apps_v1_api, "nginx-ingress", ns, 1)
Loading