mirror of
https://github.com/azaion/loader.git
synced 2026-04-23 02:56:33 +00:00
8f7deb3fca
Made-with: Cursor
18 lines
405 B
Python
18 lines
405 B
Python
import time
|
|
|
|
|
|
def test_health_latency_p95(base_url, api_client):
|
|
# Arrange
|
|
times = []
|
|
# Act
|
|
for _ in range(100):
|
|
start = time.perf_counter()
|
|
response = api_client.get(f"{base_url}/health")
|
|
elapsed = time.perf_counter() - start
|
|
times.append(elapsed)
|
|
response.raise_for_status()
|
|
times.sort()
|
|
p95 = times[94]
|
|
# Assert
|
|
assert p95 <= 0.1
|