From b5a292d7dde7fccea32e9f9ad331d6eb5b3fc79d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 26 Feb 2026 10:12:46 +0100 Subject: [PATCH] test/infamy: catch TimeoutError in curl() to allow retries Python's urllib.request wraps OSError in URLError during the connection phase, but NOT during response reading (getresponse()). This means a timeout that fires after the TCP handshake completes, e.g. when a service accepts the connection but hasn't sent a response yet, propagates as a bare TimeoutError that bypasses the exception handler, killing the entire until() retry loop on the first attempt. Signed-off-by: Joachim Wiberg --- test/infamy/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/infamy/util.py b/test/infamy/util.py index 4a40e600..9fa1e967 100644 --- a/test/infamy/util.py +++ b/test/infamy/util.py @@ -116,7 +116,7 @@ def curl(url, timeout=10, silent=False): try: with urllib.request.urlopen(url, timeout=timeout) as response: return response.read().decode('utf-8', errors='replace') - except (urllib.error.URLError, ConnectionResetError, UnicodeEncodeError) as e: + except (urllib.error.URLError, ConnectionResetError, UnicodeEncodeError, TimeoutError) as e: if not silent: print(f"[WARN] curl: failed to fetch {url}: {e}") return "" \ No newline at end of file