litellm/tests/test_litellm/router_utils
Sameer Kankute 1867ca51ae
feat(router): integrate allowed_fails_policy into health check failures
Health check failures now increment the same per-deployment failure
counters used by allowed_fails_policy, so users can control how many
health check failures of each error type are required before a
deployment enters cooldown.

- ahealth_check() preserves the original exception in its return dict
- run_with_timeout() returns a litellm.Timeout on health check timeout
- _perform_health_check() propagates exceptions to unhealthy endpoints
- _write_health_state_to_router_cache() calls _set_cooldown_deployments
  for each unhealthy endpoint that has an exception
- When allowed_fails_policy is set, the binary health check filter is
  bypassed so cooldown is the sole routing exclusion mechanism
- Safety net: if all deployments are in cooldown with
  enable_health_check_routing=True, the cooldown filter is bypassed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:58:53 +05:30
..
pre_call_checks feat(router): add per-model-group deployment affinity configuration 2026-03-19 14:44:01 +05:30
test_cooldown_cache.py fix(cooldown_cache.py): mask error string to avoid leaking sensitive prompt data 2025-08-11 18:37:57 -07:00
test_health_check_allowed_fails_integration.py feat(router): integrate allowed_fails_policy into health check failures 2026-04-02 21:58:53 +05:30
test_health_check_routing.py feat(router): add health-check-driven routing behind opt-in flag 2026-04-02 21:55:00 +05:30
test_health_state_cache.py feat(router): add health-check-driven routing behind opt-in flag 2026-04-02 21:55:00 +05:30
test_router_interactions_endpoints.py [Feat] New Logging Integration - Azure Sentinel Logger (#18146) 2025-12-18 02:04:49 +05:30
test_router_utils_common_utils.py Fix code qa 2026-02-26 12:43:06 +05:30