Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Stub the implicit STT load in the disconnect-cancellation test (#9031)

Daniel Hanba1e95680270
diff --git a/studio/backend/tests/test_stt_transcription_cancellation.py b/studio/backend/tests/test_stt_transcription_cancellation.py
index 34160f8329f..89657739673 100644
--- a/studio/backend/tests/test_stt_transcription_cancellation.py
+++ b/studio/backend/tests/test_stt_transcription_cancellation.py
@@ -167,8 +167,21 @@ def test_disconnected_raw_transcription_cancels_its_sidecar(monkeypatch):
assert cancel_event.wait(1), "disconnect must reach the sidecar"
raise SttTranscriptionCancelledError("Transcription cancelled.")
+ loaded = []
+
+ def load(model, _engine, _request_cancel_event):
+ # Stubbed for the same reason the sibling test above stubs it: the real
+ # implicit load goes through the registry, which refuses with
+ # SttModelNotDownloadedError (409) unless a snapshot happens to be on disk.
+ # Without this the disconnect below is never reached and the assert reads
+ # `409 == 499`, which is what this test does on a machine that has never
+ # downloaded an STT model. Cancellation, not download state, is the subject.
+ loaded.append(model)
+ return None
+
sidecar = _Sidecar()
monkeypatch.setattr(inference_route, "_stt_sidecar_for", lambda _engine: sidecar)
+ monkeypatch.setattr(inference_route, "_stt_lifecycle", lambda: (load, None))
monkeypatch.setattr(
inference_route,
"_resolve_serving_stt_engine",
@@ -189,6 +202,10 @@ def test_disconnected_raw_transcription_cancels_its_sidecar(monkeypatch):
assert raised.value.status_code == 499
assert sidecar.cancelled is True
+ # The stub has to stay load-bearing. If the route stops loading through the
+ # registry, this records nothing and the stub quietly becomes dead code that
+ # keeps the test green for a path it no longer covers.
+ assert loaded == ["small"], f"the transcribe path did not load through the registry: {loaded}"
def test_server_cancel_watcher_abandons_the_request_and_keeps_the_server():