From 7e331eddddee4a3f7ef74ab95d558330e4856551 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 14 Jan 2025 14:55:47 +0000 Subject: [PATCH] test_ingress: fix service ip poller get_external_service_ip repeatedly attempts to retrieve the specified service ip. The problem is that it uses "is None" checks to determine if an ip was retrieved. This returns "False" for empty strings, so the loop exits prematurely. Note that "is None" checks are strongly discouraged in Python. While at it, we're bumpting the timeout as well. --- tests/integration/tests/test_ingress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/tests/test_ingress.py b/tests/integration/tests/test_ingress.py index 06b9797dff..481c7d9e1c 100644 --- a/tests/integration/tests/test_ingress.py +++ b/tests/integration/tests/test_ingress.py @@ -41,7 +41,7 @@ def get_ingress_service_node_port(p): def get_external_service_ip(instance: harness.Instance, service_namespace) -> str: try_count = 0 ingress_ip = None - while ingress_ip is None and try_count < 20: + while not ingress_ip and try_count < 60: try_count += 1 for svcns in service_namespace: svc = svcns["service"] @@ -64,7 +64,7 @@ def get_external_service_ip(instance: harness.Instance, service_namespace) -> st .stdout.decode() .replace("'", "") ) - if ingress_ip is not None: + if not ingress_ip: return ingress_ip except subprocess.CalledProcessError: ingress_ip = None