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.

Give the embedder unload race test room for a slow release (#15082)

Daniel Hanad90a001f460
diff --git a/studio/backend/tests/test_rag_embeddings.py b/studio/backend/tests/test_rag_embeddings.py
index b4bc919666a..d069bd5be71 100644
--- a/studio/backend/tests/test_rag_embeddings.py
+++ b/studio/backend/tests/test_rag_embeddings.py
@@ -432,8 +432,12 @@ def test_st_unload_waits_for_encode_admitted_before_model_lookup(monkeypatch):
closer.start()
assert unload_done.wait(timeout = 0.05) is False
finish_lookup.set()
- worker.join(timeout = 2)
- closer.join(timeout = 2)
+ # The release runs gc.collect() and, once a device is detected, a GPU cache clear: late in
+ # a busy xdist worker that took over 2s and the old join returned before "unload" landed.
+ worker.join(timeout = 30)
+ closer.join(timeout = 30)
+ assert not worker.is_alive(), "the encode never finished"
+ assert not closer.is_alive(), "the unload never finished"
assert errors == []
assert order == ["encode", "unload"]