Skip to content

test: fix flaky ui-refresh e2e by quiescing the auto-title call before mute assertions#210

Open
CyberDefenseOperations wants to merge 1 commit into
andrewyng:mainfrom
CyberDefenseOperations:contrib/fix-flaky-ui-refresh-e2e
Open

test: fix flaky ui-refresh e2e by quiescing the auto-title call before mute assertions#210
CyberDefenseOperations wants to merge 1 commit into
andrewyng:mainfrom
CyberDefenseOperations:contrib/fix-flaky-ui-refresh-e2e

Conversation

@CyberDefenseOperations

Copy link
Copy Markdown

When the approved turn completes, mark_idle spawns the auto-title completion as a fire-and-forget task that runs provider.complete via asyncio.to_thread. The scripted E2EProvider records that call (then raises on the exhausted turn queue, which autotitle swallows), so one extra provider.calls entry lands at a nondeterministic time — frequently between the calls_before snapshot and the "provider not re-invoked" assertion in the mute step. On an idle machine this failed ~6/8 runs.

Fix: wait for the session to leave mgr._autotitle_inflight (the same settling idiom tests/test_autotitle.py already uses) before taking the snapshot, so the title call is deterministically included in the baseline. The mute guarantee — a muted inbound must not deliver a turn or re-invoke the provider — is asserted exactly as before. Verified 15/15 in a loop.

…e mute assertions

When the approved turn completes, mark_idle spawns the auto-title completion
as a fire-and-forget task running provider.complete via asyncio.to_thread. The
scripted E2EProvider records that call (then raises on the exhausted turn
queue, which autotitle swallows), so one extra provider.calls entry lands at a
nondeterministic time - frequently between the calls_before snapshot and the
'provider not re-invoked' assertion in the mute step. Wait for SID to leave
mgr._autotitle_inflight (the settling idiom test_autotitle.py already uses)
before snapshotting, so the title call is deterministically included in the
baseline. The mute guarantee is asserted exactly as before. Verified 15/15.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant