From aa518e9686958829574361fc80fbdc9af453c6b1 Mon Sep 17 00:00:00 2001 From: Joao Gilberto Magalhaes Date: Mon, 16 Feb 2026 12:13:13 -0500 Subject: [PATCH] Adjust health checks and retry logic in E2E tests for improved CI reliability --- tests_e2e/docker/docker-compose-acme-e2e.yml | 6 +++--- tests_e2e/test_docker_compose.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests_e2e/docker/docker-compose-acme-e2e.yml b/tests_e2e/docker/docker-compose-acme-e2e.yml index 3193b64..21bc259 100644 --- a/tests_e2e/docker/docker-compose-acme-e2e.yml +++ b/tests_e2e/docker/docker-compose-acme-e2e.yml @@ -71,10 +71,10 @@ services: - pebble healthcheck: test: ["CMD", "curl", "-skf", "https://pebble:14000/dir"] - interval: 5s + interval: 1s timeout: 3s - start_period: 5s - retries: 3 + start_period: 5s # Sufficient time for CI environments + retries: 20 # Enough retries for slower CI networks: - acme-test restart: "no" diff --git a/tests_e2e/test_docker_compose.py b/tests_e2e/test_docker_compose.py index cf036b9..1c850b7 100644 --- a/tests_e2e/test_docker_compose.py +++ b/tests_e2e/test_docker_compose.py @@ -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