From 37aec0a1ab747a13ff93406f85d6507a4a60e31c Mon Sep 17 00:00:00 2001 From: shin-bot-litellm Date: Sun, 1 Feb 2026 00:22:30 +0000 Subject: [PATCH] fix(test): add retry logic to flaky e2e_openai_endpoints tests These tests make external API calls to OpenAI and Anthropic which can be flaky due to: - Transient network issues - API rate limits - Temporary service unavailability Added @pytest.mark.flaky(retries=3, delay=2) decorator to: - test_streaming_response - test_anthropic_with_responses_api - test_cancel_response - test_cancel_streaming_response This matches the existing pattern used by test_basic_response. --- tests/openai_endpoints_tests/test_e2e_openai_responses_api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py b/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py index 584f7f4d32a..d0bcaf7283f 100644 --- a/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py +++ b/tests/openai_endpoints_tests/test_e2e_openai_responses_api.py @@ -91,6 +91,7 @@ def test_basic_response(): get_response = client.responses.retrieve(response.id) +@pytest.mark.flaky(retries=3, delay=2) def test_streaming_response(): client = get_test_client() stream = client.responses.create( @@ -120,6 +121,7 @@ def test_bad_request_bad_param_error(): model="gpt-4o", input="This should fail", temperature=2000 ) +@pytest.mark.flaky(retries=3, delay=2) def test_anthropic_with_responses_api(): client = get_test_client() response = client.responses.create( @@ -130,6 +132,7 @@ def test_anthropic_with_responses_api(): print("anthropic response=", response) +@pytest.mark.flaky(retries=3, delay=2) def test_cancel_response(): try: client = get_test_client() @@ -152,6 +155,7 @@ def test_cancel_response(): raise e +@pytest.mark.flaky(retries=3, delay=2) def test_cancel_streaming_response(): try: client = get_test_client()