mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
test(streaming): tolerate Vertex 429 wrapped in MidStreamFallbackError (#28669)
Streaming 429s are wrapped in MidStreamFallbackError so the Router can fall back; the existing 'except litellm.RateLimitError: pass' in test_vertex_ai_stream no longer matches, causing the generic pytest.fail branch to fire when upstream Vertex returns 429. Add a sibling except for MidStreamFallbackError that only swallows it when e.original_exception is a RateLimitError, so unrelated streaming failures still fail the test.
This commit is contained in:
parent
1b141bc588
commit
574ee7526d
1 changed files with 5 additions and 0 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue