mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-11-21 17:41:44 -08:00
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:
2 files changed
+5
-2
No files matched your search
@@ -0,0 +1 @@
|
||||
CI: Log the last exception happening when waiting for an ingress to become ready.
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user