Merge pull request #1078 from element-hq/gaelg/log-last-exception

pytest: log ingress_ready last exception if it still fails after 30s
This commit is contained in:
Gaël Goinvic authored and GitHub committed 2026-02-27 09:23:15 +01:00
commit 03ff3bb658
2 files changed
+5 -2

No files matched your search

+1
View File
@@ -0,0 +1 @@
CI: Log the last exception happening when waiting for an ingress to become ready.
+4 -2
View File
@@ -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