1
0
Fork 0

Adjust health checks and retry logic in E2E tests for improved CI reliability

This commit is contained in:
Joao Gilberto Magalhaes 2026-02-16 12:13:13 -05:00
parent 4df8666a2b
commit aa518e9686
2 changed files with 7 additions and 7 deletions

View file

@ -932,11 +932,11 @@ class TestACME:
"""Test that Pebble successfully issues a certificate"""
# Wait for certificate issuance (Certbot runs in background loop)
# Typical time: 10-15 seconds from container start
max_wait = 30
check_interval = 2
max_retries = 30
check_interval = 1
has_success = False
for attempt in range(max_wait // check_interval):
for attempt in range(max_retries):
result = subprocess.run(
["docker", "logs", "docker-haproxy-1"],
capture_output=True,
@ -961,7 +961,7 @@ class TestACME:
# Check if we can at least connect to Pebble
has_pebble_connection = "pebble:14000/dir" in logs or "pebble:14000" in logs
assert has_pebble_connection, \
f"HAProxy cannot connect to Pebble ACME server after {max_wait}s. Check docker network.\nLogs:\n{logs[-2000:]}"
f"HAProxy cannot connect to Pebble ACME server after {max_retries}s. Check docker network.\nLogs:\n{logs[-2000:]}"
# Verify merged certificate file exists
# EasyHAProxy merges cert+key from /etc/easyhaproxy/certs/live/ to /etc/easyhaproxy/certs/certbot/{domain}.pem