From 5bd4da0389f42d1b0f32f27c2061d17523f7cdab Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 4 Sep 2026 19:16:51 -0700 Subject: [PATCH] test(health): score the liveliness probe on the median of five warm polls --- .../proxy/health_endpoints/test_health_endpoints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py index c9cd4e0d9a1..e9e58347337 100644 --- a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py +++ b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py @@ -1205,8 +1205,9 @@ def test_health_liveliness_endpoint(proxy_client): assert response.status_code == 200, f"Expected 200 OK, got {response.status_code}: {response.text}" assert response.json() == "I'm alive!", f"Expected 'I'm alive!' message, got: {response.json()}" - fastest_ms: Final = min(duration_ms for duration_ms, _ in polls) - assert fastest_ms < 100, f"Fastest of {len(polls)} health checks took {fastest_ms:.2f}ms, expected < 100ms" + durations_ms: Final = tuple(sorted(duration_ms for duration_ms, _ in polls)) + median_ms: Final = durations_ms[len(durations_ms) // 2] + assert median_ms < 100, f"Median of {len(polls)} health checks took {median_ms:.2f}ms, expected < 100ms" def test_health_liveness_endpoint(proxy_client):