fix(tests): run the false-interruption resume tests on virtual time - #7179
Merged
longcw merged 1 commit intoSep 9, 2026
Merged
Conversation
longcw
approved these changes
Sep 9, 2026
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.
Problem
tests/test_false_interruption_resume.pyruns on the real clock and on a shared event loop, and itcan fail on CI over code it does not touch. It failed that way on #7159 on 7 September, where it
was reported as unrelated to that PR and the contributor closed and reopened to re-run CI.
The test asserts that
_false_interruption_pendingis true after sleeping past thefalse-interruption timeout. That flag is transient:
_on_timeoutsets it only while theend-of-turn decision is still open, and
_on_turn_settledclears it again once the decisionsettles. Sampled across the span on an idle machine it is true only between 0.30s and 0.45s, and
the test samples at 0.35s.
What closes that window early is not the test's own sleep running late. The bounce task in
_run_eou_detectionanchors its wait tolast_speaking_time + endpointing_delay. If the loop isstarved before that task's first step, the anchor has already passed, the wait collapses to zero
and the turn settles immediately. Settling commits the turn, and
_cancel_speech_pausecancels thefalse-interruption timer before it can set the flag at all, so the test wakes and reads false.
Changes
Marks the module
virtual_timeandno_concurrent, the pair already used by the thirty-threemodules that run this way, including
test_audio_recognition_aclose.pyandtest_disallow_interruptions_pause.py. That loop advances its clock only when it goes idle, sorunner contention cannot move a deadline and the ordering the test depends on is fixed.
Nothing else changes. No source file, no assertion, no tolerance and no constant is touched, and
the
unitcategory marker is kept so selection is unchanged. The module goes from about 3.7s ofreal sleeping to 0.08s.