From b401fb214435de7422591f63fe81f6e38f64cc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Thu, 26 Feb 2026 14:58:09 +0100 Subject: [PATCH] pytest: log ingress_ready last exception if it still fails after 30s --- newsfragments/1078.internal.md | 1 + tests/integration/fixtures/helm.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 newsfragments/1078.internal.md diff --git a/newsfragments/1078.internal.md b/newsfragments/1078.internal.md new file mode 100644 index 00000000..64c9034f --- /dev/null +++ b/newsfragments/1078.internal.md @@ -0,0 +1 @@ +CI: Log the last exception happening when waiting for an ingress to become ready. diff --git a/tests/integration/fixtures/helm.py b/tests/integration/fixtures/helm.py index 716b748c..6ae5a969 100644 --- a/tests/integration/fixtures/helm.py +++ b/tests/integration/fixtures/helm.py @@ -231,6 +231,7 @@ def ingress_ready(cluster, kube_client: AsyncClient, matrix_stack, generated_dat if rule.host: attempt = 0 + last_exception = None while attempt < 30: try: # Wait for the port and certificate to be available @@ -241,13 +242,14 @@ def ingress_ready(cluster, kube_client: AsyncClient, matrix_stack, generated_dat writer.close() await writer.wait_closed() break - except (ConnectionResetError, ConnectionRefusedError, SSLCertVerificationError, TimeoutError): + except (ConnectionResetError, ConnectionRefusedError, SSLCertVerificationError, TimeoutError) as e: await asyncio.sleep(1) attempt += 1 + last_exception = e else: raise Exception( f"Unable to connect to Ingress/{generated_data.release_name}-{ingress_suffix}" - " externally after 30s" + f" externally after 30s. Last exception : {last_exception}" ) return _ingress_ready