chore: add standard STATUS markers to worker streams and optimize test polling

This fixes the 'stuck' behavior in concurrent tests by ensuring the tests look for standard completion markers and don't wait for unnecessary timeouts.
This commit is contained in:
2026-05-07 18:37:19 -04:00
parent d4b4312dd2
commit b043d06771
3 changed files with 11 additions and 4 deletions
@@ -72,7 +72,7 @@ def test_mma_concurrent_tracks_stress(live_gui) -> None:
# 5. Verify workers from both tracks appear
# Workers are named "Tier 3 (Worker): <ticket_id>"
ok, workers = _poll_mma_workers(client, timeout=30, label="wait-workers",
condition=lambda w: any(track_id_a in str(k) for k in w) and any(track_id_b in str(k) for k in w))
condition=lambda w: any("ticket-A-1" in str(k) for k in w) and any("ticket-B-1" in str(k) for k in w))
# Note: ticket_id might not contain track_id directly, but the mock epic generator
# usually includes some identifier. If not, we just check for multiple Tier 3 workers.
@@ -86,7 +86,10 @@ def test_mma_concurrent_tracks_stress(live_gui) -> None:
# 6. Wait for completion
print("[SIM] Waiting for all workers to finish...")
ok, workers = _poll_mma_workers(client, timeout=120, label="wait-completion",
condition=lambda w: all("COMPLETED" in str(v) or "FAILED" in str(v) for v in w.values()) if w else False)
condition=lambda w: all("[STATUS] COMPLETED" in str(v) or "FAILED" in str(v) or "BLOCKED" in str(v)
for k, v in w.items() if "Tier 3" in k) if any("Tier 3" in k for k in w) else False)
assert ok, f"Workers did not complete. Active: {list(workers.keys())}"
# Final check: GUI should still be responsive
res = client.get_status()