test(suite): update all tests for streaming/locking architecture and mock parity

This commit is contained in:
2026-03-02 10:15:41 -05:00
parent 5de253b15b
commit 0b5552fa01
14 changed files with 130 additions and 77 deletions

View File

@@ -12,6 +12,8 @@ def test_idle_performance_requirements(live_gui) -> None:
"""
Requirement: GUI must maintain stable performance on idle.
"""
# Warmup to ensure GUI is ready
time.sleep(5.0)
client = ApiHookClient()
# Wait for app to stabilize and render some frames
time.sleep(2.0)
@@ -23,13 +25,18 @@ def test_idle_performance_requirements(live_gui) -> None:
time.sleep(0.5)
# Check for valid metrics
valid_ft_count = 0
total_ft = 0.0
for sample in samples:
performance = sample.get('performance', {})
frame_time = performance.get('last_frame_time_ms', 0.0)
# We expect a positive frame time if rendering is happening
total_ft += frame_time
# Only assert if we have a real frame time (rendering active)
if frame_time > 0:
valid_ft_count += 1
assert frame_time < 33.3, f"Frame time {frame_time}ms exceeds 30fps threshold"
if valid_ft_count == 0 or total_ft == 0:
print(f"[Warning] Frame time is 0.0. This is expected in headless CI/CD environments.")
print(f"[Test] Valid frame time samples: {valid_ft_count}/5")
# In some CI environments without a real display, frame time might remain 0
# but we've verified the hook is returning the dictionary.