From 58d06fa938933cdf9483ed2dbd6a993c5dc2939f Mon Sep 17 00:00:00 2001 From: shadowmodder Date: Sun, 1 Nov 2026 10:03:36 -0600 Subject: [PATCH] test(router): fix direct-call num_retries assertion to match SDK-retry behavior --- tests/unit/test_router_per_deployment_num_retries.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_router_per_deployment_num_retries.py b/tests/unit/test_router_per_deployment_num_retries.py index b08ae25c438..a7fbf0df60a 100644 --- a/tests/unit/test_router_per_deployment_num_retries.py +++ b/tests/unit/test_router_per_deployment_num_retries.py @@ -507,10 +507,10 @@ class TestNoProviderRetryAmplification: async def test_direct_completion_still_forwards_num_retries_to_provider(self): """ For a NON-routed direct ``litellm.acompletion`` call, ``num_retries`` remains an - alias for the provider client's ``max_retries`` (the instructor use case). The - provider SDK therefore retries in addition to litellm's own retry wrapper, so the - upstream count exceeds ``num_retries + 1`` - proving the routed-call fix did not - change direct-call behaviour. + alias for the provider client's ``max_retries`` (the instructor use case). + litellm itself has no retry wrapper for direct calls, so the provider SDK + performs all the retries and the upstream count is exactly ``num_retries + 1`` - + proving the routed-call fix did not change direct-call behaviour. """ counter = self._install_counting_upstream() num_retries = 2 @@ -523,7 +523,7 @@ class TestNoProviderRetryAmplification: messages=[{"role": "user", "content": "hi"}], num_retries=num_retries, ) - assert counter["n"] > num_retries + 1 + assert counter["n"] == num_retries + 1 class _AttemptCounter(CustomLogger):