mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
fix(tests+docs): fix tuple unpacking and docs test failures
- Update test mocks that return (healthy, unhealthy) to return
(healthy, unhealthy, {}) to match the new 3-value signature
- Update test unpackings of perform_shared_health_check to use
healthy, unhealthy, _ = ...
- Add health_check_ignore_transient_errors to router_settings section
in config_settings.md (it is a Router constructor param, so the doc
test requires it there; it also lives in general_settings for proxy use)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d000af1c34
commit
c2b2668d7a
4 changed files with 10 additions and 9 deletions
|
|
@ -397,6 +397,7 @@ router_settings:
|
|||
| guardrail_list | List[GuardrailTypedDict] | List of guardrail configurations for guardrail load balancing. Enables load balancing across multiple guardrail deployments with the same guardrail_name. [Further Docs](./guardrails/guardrail_load_balancing.md) |
|
||||
| enable_health_check_routing | boolean | If true, enables health check-driven deployment filtering to avoid routing requests to unhealthy deployments |
|
||||
| health_check_staleness_threshold | integer | Maximum age in seconds for cached health check results before marking deployments as stale |
|
||||
| health_check_ignore_transient_errors | boolean | If true, 429 (rate limit) and 408 (timeout) health check failures are ignored and do not affect routing or cooldown |
|
||||
|
||||
|
||||
### environment variables - Reference
|
||||
|
|
|
|||
|
|
@ -2410,7 +2410,7 @@ async def test_run_background_health_check_reflects_llm_model_list(monkeypatch):
|
|||
model_list, details, max_concurrency=None
|
||||
):
|
||||
called_model_lists.append(copy.deepcopy(model_list))
|
||||
return (["healthy"], ["unhealthy"])
|
||||
return (["healthy"], ["unhealthy"], {})
|
||||
|
||||
monkeypatch.setattr(proxy_server, "health_check_interval", 1)
|
||||
monkeypatch.setattr(proxy_server, "health_check_details", None)
|
||||
|
|
@ -2460,7 +2460,7 @@ async def test_background_health_check_skip_disabled_models(monkeypatch):
|
|||
model_list, details, max_concurrency=None
|
||||
):
|
||||
called_model_lists.append(copy.deepcopy(model_list))
|
||||
return (["healthy"], [])
|
||||
return (["healthy"], [], {})
|
||||
|
||||
monkeypatch.setattr(proxy_server, "health_check_interval", 1)
|
||||
monkeypatch.setattr(proxy_server, "health_check_details", None)
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ async def test_perform_health_check_and_save_passes_model_id_to_perform_health_c
|
|||
unhealthy = []
|
||||
|
||||
async def mock_perform_health_check(model_list, model=None, cli_model=None, details=True, model_id=None, max_concurrency=None):
|
||||
return healthy, unhealthy
|
||||
return healthy, unhealthy, {}
|
||||
|
||||
with patch(
|
||||
"litellm.proxy.health_endpoints._health_endpoints.perform_health_check",
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class TestSharedHealthCheckManager:
|
|||
model_list = [{"model_name": "test-model", "litellm_params": {"model": "test-model"}}]
|
||||
|
||||
with patch("litellm.proxy.health_check_utils.shared_health_check_manager.perform_health_check") as mock_perform:
|
||||
healthy, unhealthy = await shared_health_manager.perform_shared_health_check(
|
||||
healthy, unhealthy, _ = await shared_health_manager.perform_shared_health_check(
|
||||
model_list, details=True
|
||||
)
|
||||
|
||||
|
|
@ -268,9 +268,9 @@ class TestSharedHealthCheckManager:
|
|||
expected_unhealthy = []
|
||||
|
||||
with patch("litellm.proxy.health_check_utils.shared_health_check_manager.perform_health_check") as mock_perform:
|
||||
mock_perform.return_value = (expected_healthy, expected_unhealthy)
|
||||
mock_perform.return_value = (expected_healthy, expected_unhealthy, {})
|
||||
|
||||
healthy, unhealthy = await shared_health_manager.perform_shared_health_check(
|
||||
healthy, unhealthy, _ = await shared_health_manager.perform_shared_health_check(
|
||||
model_list, details=True
|
||||
)
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ class TestSharedHealthCheckManager:
|
|||
model_list = [{"model_name": "test-model", "litellm_params": {"model": "test-model"}}]
|
||||
|
||||
with patch("asyncio.sleep") as mock_sleep: # Mock sleep to avoid actual delay
|
||||
healthy, unhealthy = await shared_health_manager.perform_shared_health_check(
|
||||
healthy, unhealthy, _ = await shared_health_manager.perform_shared_health_check(
|
||||
model_list, details=True
|
||||
)
|
||||
|
||||
|
|
@ -324,9 +324,9 @@ class TestSharedHealthCheckManager:
|
|||
|
||||
with patch("asyncio.sleep") as mock_sleep, \
|
||||
patch("litellm.proxy.health_check_utils.shared_health_check_manager.perform_health_check") as mock_perform:
|
||||
mock_perform.return_value = (expected_healthy, expected_unhealthy)
|
||||
mock_perform.return_value = (expected_healthy, expected_unhealthy, {})
|
||||
|
||||
healthy, unhealthy = await shared_health_manager.perform_shared_health_check(
|
||||
healthy, unhealthy, _ = await shared_health_manager.perform_shared_health_check(
|
||||
model_list, details=True
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue