Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(streaming): tolerate Vertex 429 wrapped in MidStreamFallbackError (#28669)

yuneng-jiang574ee7526db6
diff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.py
index b1a93c380b2..10f351714e1 100644
--- a/tests/local_testing/test_streaming.py
+++ b/tests/local_testing/test_streaming.py
@@ -993,6 +993,11 @@ def test_vertex_ai_stream(provider):
except litellm.RateLimitError as e:
pass
+ except litellm.exceptions.MidStreamFallbackError as e:
+ # Streaming 429s are wrapped in MidStreamFallbackError so the
+ # Router can fall back; treat as a transient rate-limit pass.
+ if not isinstance(e.original_exception, litellm.RateLimitError):
+ pytest.fail(f"Error occurred: {e}")
except Exception as e:
pytest.fail(f"Error occurred: {e}")