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(router): run the fallback provider-408 cooldown regression inside an event loop

yassin2f719fec521c
diff --git a/tests/test_litellm/router_utils/test_fallback_event_handlers.py b/tests/test_litellm/router_utils/test_fallback_event_handlers.py
index 15db22dc758..783f8da31e9 100644
--- a/tests/test_litellm/router_utils/test_fallback_event_handlers.py
+++ b/tests/test_litellm/router_utils/test_fallback_event_handlers.py
@@ -984,7 +984,8 @@ class TestTriggerCooldownForFailedDeployment:
mock_set_cooldown.assert_not_called()
mock_increment.assert_not_called()
- def test_still_cools_down_provider_408_before_caller_deadline(self):
+ @pytest.mark.asyncio
+ async def test_still_cools_down_provider_408_before_caller_deadline(self):
"""client_side_timeout only records that the caller configured a timeout. A 408
that comes back before that deadline was raised by the provider itself, so it is
a real health signal and must still cool the deployment down."""