test: fix flaky ui-refresh e2e by quiescing the auto-title call before mute assertions#210
Open
CyberDefenseOperations wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the approved turn completes,
mark_idlespawns the auto-title completion as a fire-and-forget task that runsprovider.completeviaasyncio.to_thread. The scriptedE2EProviderrecords that call (then raises on the exhausted turn queue, which autotitle swallows), so one extraprovider.callsentry lands at a nondeterministic time — frequently between thecalls_beforesnapshot 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 idiomtests/test_autotitle.pyalready 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.