From b552f2fbc801630ea67350f18e39df25cc4e76a4 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 19 Jun 2026 04:33:52 -0700 Subject: [PATCH] studio: fix two backend CI test failures (capability dict + MTP recovery race) (#6464) test_safetensors_capability_advertise: detect_reasoning_flags now returns a reasoning_effort_levels key, so the none-template expectation must include it. test_tensor_parallel::test_runtime_recovery_reloads_without_mtp: the assertion raced the recovery thread, which sets _spec_fallback_reason just before its finally clears _mtp_runtime_fallback_in_progress. Wait for the flag to clear before asserting. Co-authored-by: danielhanchen --- .../backend/tests/test_safetensors_capability_advertise.py | 1 + studio/backend/tests/test_tensor_parallel.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/studio/backend/tests/test_safetensors_capability_advertise.py b/studio/backend/tests/test_safetensors_capability_advertise.py index 1e8fb9e2b2..13cb6bbd46 100644 --- a/studio/backend/tests/test_safetensors_capability_advertise.py +++ b/studio/backend/tests/test_safetensors_capability_advertise.py @@ -107,6 +107,7 @@ def test_detect_safetensors_features_none_template_returns_all_false(): "supports_reasoning": False, "reasoning_style": "enable_thinking", "reasoning_always_on": False, + "reasoning_effort_levels": [], "supports_preserve_thinking": False, "supports_tools": False, } diff --git a/studio/backend/tests/test_tensor_parallel.py b/studio/backend/tests/test_tensor_parallel.py index 5b1138ef09..86ac79eda9 100644 --- a/studio/backend/tests/test_tensor_parallel.py +++ b/studio/backend/tests/test_tensor_parallel.py @@ -365,6 +365,11 @@ def test_runtime_recovery_reloads_without_mtp(monkeypatch): while b._spec_fallback_reason != "runtime_error" and time.monotonic() < deadline: time.sleep(0.02) assert b._spec_fallback_reason == "runtime_error" + # The reload thread clears the single-flight flag in its finally, a beat after + # it sets the fallback reason -- wait for that instead of racing the thread. + deadline = time.monotonic() + 2 + while b._mtp_runtime_fallback_in_progress and time.monotonic() < deadline: + time.sleep(0.02) assert b._mtp_runtime_fallback_in_progress is False