From c6a512f3f8b090dc0596418f41bd2d6bb47a774f Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 12 Jun 2026 09:14:09 +0000 Subject: [PATCH] test(local): skip httpbin timeout probe when the service returns 5xx local_testing_part1 was failing on test_post_delay_exceeds_per_request_timeout_raises because httpbin.org/delay/10 intermittently answers 503 instead of delaying, so HTTPHandler.post raised MaskedHTTPStatusError rather than the expected Timeout. The test already means to skip when httpbin is unavailable, but its guard only probed GET /get and ignored a server error on the delay endpoint. Treat a 5xx from httpbin as 'service unavailable' and skip, which is outside this repo's control, while still asserting Timeout when httpbin genuinely delays. --- tests/local_testing/test_azure_anthropic_sync_post.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/local_testing/test_azure_anthropic_sync_post.py b/tests/local_testing/test_azure_anthropic_sync_post.py index 5ceb9ae3ed..d621a224ef 100644 --- a/tests/local_testing/test_azure_anthropic_sync_post.py +++ b/tests/local_testing/test_azure_anthropic_sync_post.py @@ -18,7 +18,10 @@ import pytest sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) from litellm.exceptions import Timeout as LitellmTimeout -from litellm.llms.custom_httpx.http_handler import _get_httpx_client +from litellm.llms.custom_httpx.http_handler import ( + MaskedHTTPStatusError, + _get_httpx_client, +) _HTTPBIN_DELAY_S = 10 _PER_REQUEST_TIMEOUT_S = 5.0 @@ -40,5 +43,7 @@ def test_post_delay_exceeds_per_request_timeout_raises(): data=json.dumps({"model": "claude", "messages": []}), timeout=_PER_REQUEST_TIMEOUT_S, ) + except MaskedHTTPStatusError as e: + pytest.skip(f"httpbin.org unavailable: {e}") finally: handler.close()