From 48287de8d8360825c85ac981ddfe9c80dba3b418 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Tue, 18 Aug 2026 12:35:23 +0200 Subject: [PATCH] test: catch every transport error in the docker health check The framework-compat fixture caught only ConnectError and TimeoutException. A container behind a bound-but-not-ready Docker port proxy resets the connection, which httpx raises as ReadError, so it escaped the handler and killed the fixture outright: 438 errors in 15 seconds, without the readiness timeout ever running. httpx.RequestError is the base of every transport failure. The other two docker conftests already catch OSError and were unaffected. --- tests/docker/asgi_framework_compat/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/asgi_framework_compat/conftest.py b/tests/docker/asgi_framework_compat/conftest.py index 553e01b98..5f9e74509 100644 --- a/tests/docker/asgi_framework_compat/conftest.py +++ b/tests/docker/asgi_framework_compat/conftest.py @@ -83,7 +83,7 @@ def wait_for_service(url: str, timeout: int = 180) -> bool: response = httpx.get(f"{url}/health", timeout=5.0) if response.status_code == 200: return True - except (httpx.ConnectError, httpx.TimeoutException): + except httpx.RequestError: pass time.sleep(1) return False @@ -105,7 +105,7 @@ def docker_services(docker_compose_file, request): if response.status_code != 200: all_healthy = False break - except (httpx.ConnectError, httpx.TimeoutException): + except httpx.RequestError: all_healthy = False break