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.

Bound the backend pytest session so a wedged xdist worker cannot eat the job (#9530)

Daniel Han26c7da6a4399
diff --git a/.github/workflows/studio-backend-ci.yml b/.github/workflows/studio-backend-ci.yml
index 20c83a9584e..2a9f0d0af51 100644
--- a/.github/workflows/studio-backend-ci.yml
+++ b/.github/workflows/studio-backend-ci.yml
@@ -259,7 +259,20 @@ jobs:
# at 82.5s (measured under -n 4 on a contended box; 75.4s serially), and the next
# ones down are 76s and 25s, so the cap is 4x the worst real test. Nothing here is
# near it, and a deadlock is caught in minutes rather than never.
+ #
+ # --timeout arms inside each xdist worker, so a stuck CONTROLLER escapes it: when a
+ # worker wedges holding the pipe, the session waits forever and no per-test cap is
+ # consulted. On the #9473 branch this step sat silent from 95% for 36.8 minutes,
+ # three runs running, each burning the whole 45 minute budget and reporting
+ # "cancelled" -- unreadable against ordinary concurrency supersession.
+ #
+ # So bound the session from outside, where a wedged worker cannot defeat it. SIGINT
+ # first so pytest dumps where it was stuck, SIGKILL 60s later if it will not.
+ # Reproduced with a test forking a child that never exits: unwrapped it hangs
+ # silently, wrapped it exits 124 through execnet safe_terminate -> workerpool.waitall.
+ # Expect a stuck FRAME, not always a test name. 1500s is ~3x the 8-10 minute norm.
run: |
+ timeout --signal=INT --kill-after=60 1500 \
python -m pytest tests/ -q --tb=short -n 4 --timeout=330 \
--ignore=tests/test_studio_api.py \
--ignore=tests/test_streaming_stripper.py \