From 2d2969a9ca6d0462b22342a1ab0db7949a41a5bb Mon Sep 17 00:00:00 2001 From: Gabor Javorszky Date: Thu, 23 Oct 2025 17:11:40 +0100 Subject: [PATCH 1/2] Wrap oidc fclo initiated test in a while loop --- tests/suite/test_oidc_fclo.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/suite/test_oidc_fclo.py b/tests/suite/test_oidc_fclo.py index 1c2e57309a..c11794e22e 100644 --- a/tests/suite/test_oidc_fclo.py +++ b/tests/suite/test_oidc_fclo.py @@ -193,19 +193,29 @@ def test_oidc( kube_apis.v1, ingress_controller_prerequisites.namespace, "nginx-ingress-" ) - logs = kube_apis.v1.read_namespaced_pod_log(nic_pod_name, ingress_controller_prerequisites.namespace) + retry = 0 + count_fclo_initiated = 0 + logs = "" + while count_fclo_initiated != 2 and retry < 10: + wait_before_test(1) # wait one second before retrying - count_get_fclo = logs.count("GET /front_channel_logout?sid=") - count_fclo_initiated = logs.count("OIDC Front-Channel Logout initiated for sid:") + logs = kube_apis.v1.read_namespaced_pod_log(nic_pod_name, ingress_controller_prerequisites.namespace) - assert ( - count_get_fclo == 2 - ), f"nginx-ingress logs do not contain GET /front_channel_logout?sid= twice, got {count_get_fclo}" + count_fclo_initiated = logs.count("OIDC Front-Channel Logout initiated for sid:") + + print(f"OIDC FCLO Initiated count in the while loop: {count_fclo_initiated}, retrying... {retry}") + retry = retry + 1 assert ( count_fclo_initiated == 2 ), f"nginx-ingress logs do not contain OIDC Front-Channel Logout initiated for sid twice, got {count_fclo_initiated}" + count_get_fclo = logs.count("GET /front_channel_logout?sid=") + + assert ( + count_get_fclo == 2 + ), f"nginx-ingress logs do not contain GET /front_channel_logout?sid= twice, got {count_get_fclo}" + delete_secret(kube_apis.v1, secret_one_name, test_namespace) delete_secret(kube_apis.v1, secret_two_name, test_namespace) delete_policy(kube_apis.custom_objects, pol_one, test_namespace) From cfe980e9443e8fffdc732f6699026cd1636aed09 Mon Sep 17 00:00:00 2001 From: Gabor Javorszky Date: Thu, 23 Oct 2025 17:16:30 +0100 Subject: [PATCH 2/2] Implement copilot suggestions --- tests/suite/test_oidc_fclo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/suite/test_oidc_fclo.py b/tests/suite/test_oidc_fclo.py index c11794e22e..8c636d5973 100644 --- a/tests/suite/test_oidc_fclo.py +++ b/tests/suite/test_oidc_fclo.py @@ -196,7 +196,8 @@ def test_oidc( retry = 0 count_fclo_initiated = 0 logs = "" - while count_fclo_initiated != 2 and retry < 10: + expected_fclo_count = 2 + while count_fclo_initiated != expected_fclo_count and retry < 10: wait_before_test(1) # wait one second before retrying logs = kube_apis.v1.read_namespaced_pod_log(nic_pod_name, ingress_controller_prerequisites.namespace) @@ -204,16 +205,16 @@ def test_oidc( count_fclo_initiated = logs.count("OIDC Front-Channel Logout initiated for sid:") print(f"OIDC FCLO Initiated count in the while loop: {count_fclo_initiated}, retrying... {retry}") - retry = retry + 1 + retry += 1 assert ( - count_fclo_initiated == 2 + count_fclo_initiated == expected_fclo_count ), f"nginx-ingress logs do not contain OIDC Front-Channel Logout initiated for sid twice, got {count_fclo_initiated}" count_get_fclo = logs.count("GET /front_channel_logout?sid=") assert ( - count_get_fclo == 2 + count_get_fclo == expected_fclo_count ), f"nginx-ingress logs do not contain GET /front_channel_logout?sid= twice, got {count_get_fclo}" delete_secret(kube_apis.v1, secret_one_name, test_namespace)