Skip to content

fix(tests): run the false-interruption resume tests on virtual time - #7179

Merged
longcw merged 1 commit into
livekit:mainfrom
omChauhanDev:fix/false-interruption-resume-virtual-time
Sep 9, 2026
Merged

fix(tests): run the false-interruption resume tests on virtual time#7179
longcw merged 1 commit into
livekit:mainfrom
omChauhanDev:fix/false-interruption-resume-virtual-time

Conversation

@omChauhanDev

Copy link
Copy Markdown
Contributor

Problem

tests/test_false_interruption_resume.py runs on the real clock and on a shared event loop, and it
can 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_pending is true after sleeping past the
false-interruption timeout. That flag is transient: _on_timeout sets it only while the
end-of-turn decision is still open, and _on_turn_settled clears it again once the decision
settles. 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_detection anchors its wait to last_speaking_time + endpointing_delay. If the loop is
starved 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_pause cancels the
false-interruption timer before it can set the flag at all, so the test wakes and reads false.

Changes

Marks the module virtual_time and no_concurrent, the pair already used by the thirty-three
modules that run this way, including test_audio_recognition_aclose.py and
test_disallow_interruptions_pause.py. That loop advances its clock only when it goes idle, so
runner 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 unit category marker is kept so selection is unchanged. The module goes from about 3.7s of
real sleeping to 0.08s.

@omChauhanDev
omChauhanDev requested a review from a team as a code owner September 9, 2026 02:18

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@longcw
longcw merged commit 624ab31 into livekit:main Sep 9, 2026
17 checks passed
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.

2 participants