From a3abe49ca9500030473557fe7fe52d045b6dd86d Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 10 Jun 2026 15:45:44 -0400 Subject: [PATCH] fix(test): poll for mma_state_update 'simulating' to land in test_gui_ux_event_routing --- tests/test_visual_sim_gui_ux.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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.")