Skip to content

test: freeze the clock in the transcription_delay anchor regression test - #7398

Merged
u9g merged 1 commit into
mainfrom
jason/fix-flaky-transcription-delay-anchor
Sep 22, 2026
Merged

u9g merged 1 commit into
mainfrom
jason/fix-flaky-transcription-delay-anchor

Conversation

@u9g

@u9g u9g commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Problem

test_vad_anchor_survives_a_transcript_without_timestamps[stt] failed on an unrelated PR (#7390, run):

assert 0.9810912609100342 == 0.6 ± 0.1

The test read time.time() at the top, let _on_stt_event stamp _last_final_transcript_time with a second live read, then asserted the two were 0.6s ± 0.1s apart. Any scheduler stall between the reads inflates the measured delay. That run's runner was under load (the log also shows the asyncio executor failing to join its threads within 300s), and the gap came out at 0.38s.

Fix

Monkeypatch the clock in audio_recognition to return the same now the anchor was derived from, so the assertion is exact and independent of runner speed. The test still catches the original regression: a discarded VAD anchor would report a delay of 0.

The test read the wall clock twice with real work in between and asserted
the difference within 0.1s. A scheduler stall on a loaded CI runner
pushed the measured delay to 0.98s and failed an unrelated PR.
@u9g
u9g requested a review from a team as a code owner September 22, 2026 15:23

@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

@u9g
u9g merged commit 3b7eafc into main Sep 22, 2026
26 checks passed
@u9g
u9g deleted the jason/fix-flaky-transcription-delay-anchor branch September 22, 2026 17:06
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