{{ message }}
Stub the implicit STT load in the disconnect-cancellation test - #9031
Merged
Conversation
test_disconnected_raw_transcription_cancels_its_sidecar passes in its file and
fails on its own, on any machine that has not downloaded an STT model:
assert raised.value.status_code == 499
E assert 409 == 499
E + where 409 = HTTPException(status_code=409, detail="STT model 'small' is
not downloaded. Download it in Settings, then Voice, before loading it.")
Introduced by #7984 (d20db3f, 2026-08-11), which added this test AND the
implicit registry load in _transcribe_audio_result it fails on. The test was
incomplete from birth: it stubs _stt_sidecar_for and _resolve_serving_stt_engine
but not the load, so the disconnect it exists to check is only reached when an
earlier test left an engine resident or the host has the model cached.
The sibling test directly above it, added by the same PR, does stub
_stt_lifecycle. This does the same. Cancellation, not download state, is the
subject.
Worth noting that #7984 is the same PR behind the stt_unload 500 (#9013) and the
two test_stt_ggml_sidecar unload tests that fail standalone: three defects in one
area, each invisible because a serial run happened to leave the right state
behind.
Robustification: the stub now records what it was asked to load, and the test
asserts it. Otherwise, if the route ever stops loading through the registry, the
stub becomes dead code and the test stays green for a path it no longer covers.
Checked by mutating the route to skip the load:
the transcribe path did not load through the registry: []
Verified by forcing the no-snapshot condition:
main, test alone: 1 failed (409 == 499)
main, whole file: 9 passed <- the order dependency
fixed, no snapshot: 9 passed
fixed, cached host: 9 passed
danielhanchen
force-pushed
the
fix-stt-cancel-test-stubs-load
branch
from
August 17, 2026 01:18
e6d1220 to
2a2e1d1
Compare
This was referenced Aug 17, 2026
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Member
Author
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.

test_disconnected_raw_transcription_cancels_its_sidecarpasses in its file and fails on its own, on any machine that has not downloaded an STT model:Cause
_transcribe_audio_resultdoes an implicit load through the registry before it ever reaches the sidecar:and the registry refuses unless a complete snapshot is on disk:
The test stubs
_stt_sidecar_forand_resolve_serving_stt_engine, but not the load. So the disconnect it exists to test is never reached. It gets there only when an earlier test in the file has left an engine resident, or when the host happens to have the model cached.The sibling test directly above it already stubs
_stt_lifecyclefor exactly this reason:Fix
Do the same. Cancellation, not download state, is the subject of this test.
Verification
Forcing the no-snapshot condition (
_find_complete_cached_snapshotreturningNone, which is what a runner that has never downloaded an STT model looks like):409 == 499)The gap between rows one and two is the order dependency.
Which PR, and which side is wrong
Both this test and the implicit registry load it trips over came from the same PR, #7984 (
d20db3f1f, 2026-08-11). The test was incomplete from birth, and the sibling test directly above it, added by that same PR, does stub_stt_lifecycle.Worth flagging: #7984 is also the PR behind the
stt_unload500 in #9013, and behind the twotest_stt_ggml_sidecar.pyunload tests that fail standalone onmain. Three defects in one area, each invisible because a serial run happened to leave the right state behind.Robustification
The stub now records what it was asked to load, and the test asserts it. Otherwise, if the route ever stops loading through the registry, the stub silently becomes dead code and the test stays green for a path it no longer covers. Mutating the route to skip the load:
Found while measuring whether the backend suite can run under
pytest-xdist.--dist loadsplits the file across workers, so the test lands on a worker where nothing loaded an engine first and it fails. The dependency is onmaintoday though, which is why this is a standalone fix.