test(local-runtime): trim idle-probe salvage to two invariants

Keep the two tests that were red on origin/main (probe failure keeps the clock and
unloads once telemetry recovers; confirmed busy still resets). Drop the is_idle() bool
contract test — it pins behaviour that did not change — and fold the probe-failure log
call onto two lines.
This commit is contained in:
teknium1
2026-09-14 17:52:22 -07:00
committed by Teknium
parent b83ee209d9
commit c1b7f28693
2 changed files with 2 additions and 19 deletions

View File

@@ -390,12 +390,8 @@ class LlamaServerSupervisor:
continue
probe = self._probe_idle(model_id)
if probe is None:
idle_for = int(now - self._idle_since.get(model_id, now))
logger.info(
"idle probe for %s failed; keeping idle clock (idle %ds)",
model_id,
idle_for,
)
logger.info("idle probe for %s failed; keeping idle clock (idle %ds)", model_id,
int(now - self._idle_since.get(model_id, now)))
continue
if probe is False:
self._idle_since.pop(model_id, None)

View File

@@ -645,19 +645,6 @@ def test_idle_sweep_busy_after_probe_failure_still_resets_clock(
assert handler.unloaded == []
def test_is_idle_probe_failure_reports_not_idle(stub_server, tmp_path):
"""The public bool contract is unchanged: a failed probe reads as "not idle" —
callers outside the sweep never unload on a telemetry hiccup."""
port, handler = stub_server
sup = _make_supervisor(tmp_path, port)
handler.models = {"data": [{"id": "m", "status": {"value": "loaded"}}]}
handler.slots = []
handler.metrics_error = 503
assert sup.is_idle() is False
handler.metrics_error = 0
assert sup.is_idle() is True
def test_staged_models_requires_every_split_part(tmp_path, monkeypatch):
"""A split GGUF mid-download must NOT count as staged: the picker, the
catalog's 'downloaded' flag, and the router's model list all read