31a8949d64
Files corrected: - src/fuzzy_anchor.py (18 violations) - src/patch_modal.py (14 violations) - scripts/extract_symbols.py (4 violations) - scripts/tasks/download_fonts.py (8 violations) - tests/: 23 files with indentation issues All files verified with py_compile. Remaining 4 files (test_api_events.py, test_discussion_takes_gui.py, test_gui_updates.py, test_headless_service.py) have complex multi-line with statements that require manual correction.
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
import time
|
|
import sys
|
|
import os
|
|
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
|
|
|
|
from src.api_hook_client import ApiHookClient
|
|
|
|
|
|
def test_comms_volume_stress_performance(live_gui) -> None:
|
|
time.sleep(5.0)
|
|
client = ApiHookClient()
|
|
time.sleep(2.0)
|
|
baseline_resp = client.get_performance()
|
|
baseline = baseline_resp.get("performance", {})
|
|
baseline_ft = baseline.get("last_frame_time_ms", 0.0)
|
|
large_session = []
|
|
for i in range(50):
|
|
large_session.append(
|
|
{
|
|
"role": "User",
|
|
"content": f"Stress test entry {i} " * 5,
|
|
"ts": time.time(),
|
|
"collapsed": False,
|
|
}
|
|
)
|
|
client.post_session(large_session)
|
|
time.sleep(1.0)
|
|
stress_resp = client.get_performance()
|
|
stress = stress_resp.get("performance", {})
|
|
stress_ft = stress.get("last_frame_time_ms", 0.0)
|
|
print(f"Baseline FT: {baseline_ft:.2f}ms, Stress FT: {stress_ft:.2f}ms")
|
|
if stress_ft > 0:
|
|
assert stress_ft < 100.0, (
|
|
f"Stress frame time {stress_ft:.2f}ms exceeds 10fps threshold"
|
|
)
|
|
session_data = client.get_session()
|
|
entries = session_data.get("session", {}).get("entries", [])
|
|
assert len(entries) >= 50, f"Expected at least 50 entries, got {len(entries)}"
|