diff --git a/tests/test_visual_sim_gui_ux.py b/tests/test_visual_sim_gui_ux.py index 44b8360d..0454ff4e 100644 --- a/tests/test_visual_sim_gui_ux.py +++ b/tests/test_visual_sim_gui_ux.py @@ -37,9 +37,14 @@ def test_gui_ux_event_routing(live_gui) -> None: 'tier_usage': usage, 'tickets': [] }) - time.sleep(2) - - status = client.get_mma_status() + # Poll until the new status lands. Without this, a prior test's stale + # mma_state_update is still in flight and overwrites our 'simulating'. + for _ in range(40): + status = client.get_mma_status() + if status.get('mma_status') == 'simulating': + break + time.sleep(0.25) + assert status.get('mma_status') == 'simulating', f"Expected 'simulating', got '{status.get('mma_status')}'" assert status.get('tier_usage', {}).get('Tier 1', {}).get('input') == 10 print("[SIM] Global state update verified.")