test_hosted_dashboard_performance.py file-level

at sha256:a · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:8 docs: queue board-identity follow-ups so they survive the session Capt… · aaronrene · Sep 5, 2026
1 """Performance tests for hosted governance dashboard (§HGD.12)."""
2
3 from __future__ import annotations
4
5 import time
6
7 from tests.fixtures.hosted_dashboard import free_port, start_test_hosted
8
9
10 # Documented bounds (fixture, no network).
11 SINGLE_REPO_DOC_FETCH_MS = 2000
12 STARTUP_LISTEN_MS = 2000
13
14
15 def test_single_repo_doc_fetch_bound() -> None:
16 handle, client, _ = start_test_hosted()
17 try:
18 started = time.perf_counter()
19 status, _ = client.get("/api/repos/acme/kit-demo/roadmap")
20 elapsed_ms = (time.perf_counter() - started) * 1000
21 assert status == 200
22 assert elapsed_ms < SINGLE_REPO_DOC_FETCH_MS
23 finally:
24 handle.shutdown()
25
26
27 def test_startup_listen_bound() -> None:
28 started = time.perf_counter()
29 handle, client, _ = start_test_hosted(port=free_port())
30 try:
31 elapsed_ms = (time.perf_counter() - started) * 1000
32 status, _ = client.get("/api/health", auth=False)
33 assert status == 200
34 assert elapsed_ms < STARTUP_LISTEN_MS
35 finally:
36 handle.shutdown()