mirror of
https://github.com/MervinPraison/PraisonAIUI.git
synced 2026-11-07 13:56:36 -10:00
fix(tests): warm up liveness endpoint before timing to fix flaky 3.10 CI
test_health_live_is_fast timed the first request through the Starlette TestClient, which pays one-time route/client initialization cost and measured 0.15s on a slow Python 3.10 runner (threshold 0.1s). Add a warmup request so the assertion measures steady-state latency, matching the endpoint's own <500ms target. No production code change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
bfb1eeee06
commit
d615e2e0a3
1 file changed
+5
@@ -55,6 +55,11 @@ class TestHealthEndpoint:
|
||||
"""Test liveness endpoint returns quickly."""
|
||||
import time
|
||||
|
||||
# Warm up once so the timed call measures steady-state latency rather
|
||||
# than one-time TestClient/route initialization (which can exceed the
|
||||
# threshold on slow CI runners and cause flaky failures).
|
||||
client.get("/health/live")
|
||||
|
||||
start = time.time()
|
||||
response = client.get("/health/live")
|
||||
duration = time.time() - start
|
||||
|
||||
Reference in new issue
Block a user