test_hosted_dashboard_performance.py python
36 lines 1.0 KB
Raw
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14 Reconcile reviewed credential compatibility 32254cd939885d9… Human patch 9 days ago
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()
File History 2 commits
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14 Reconcile reviewed credential compatibility 32254cd939885d9… Human patch 9 days ago
sha256:c87cf2c2f03da507f66f93922cb339a2cbebb33ad6372a6039032fb09a20da12 Reconcile reviewed Overseer recovery d47291d5d9030de5ebef71… Human minor ⚠ 10 days ago