← Back to DAGDA | Support | Source: https://github.com/BerriAI/litellm/pull/49584
Skip to content

test(router): fix direct-call num_retries assertion to match SDK-retry behavior - #49584

Open
shadowmodder wants to merge 1 commit into
BerriAI:mainfrom
shadowmodder:litellm_bugbash_proxy_router
Open

shadowmodder wants to merge 1 commit into
BerriAI:mainfrom
shadowmodder:litellm_bugbash_proxy_router

Conversation

@shadowmodder

Copy link
Copy Markdown
Contributor

Test-only change; no product behavior altered.

tests/unit/test_router_per_deployment_num_retries.py::TestNoProviderRetryAmplification::test_direct_completion_still_forwards_num_retries_to_provider fails on unmodified main: the test assumed litellm retries direct litellm.acompletion calls at its own layer in addition to the provider SDK. That premise is false — litellm has no retry wrapper for direct calls; num_retries is "alt. param for 'max_retries'", so the provider SDK performs all retries (instrumented: 1 litellm-level attempt, 3 upstream requests for num_retries=2).

Fix: corrected the assertion to == num_retries + 1 and rewrote the docstring to state the actual contract.

Tests: fails on base; 47/47 in the file after fix; 54/54 across the three retry test files; ruff clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant