The model batches are isolated with a deadline, so a Kill or a hang ends them

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 19:42:28 +02:00
1 parent c63f348dc9
commit b73a0fc2cb
6 files changed
+54 -9

No files matched your search

+12 -1
View File
@@ -958,10 +958,21 @@ def test_the_posting_text_is_fetched_once(
def test_summarise_queues_one_role_and_the_job_writes_it(
app: FastAPI, store: Store, monkeypatch: pytest.MonkeyPatch) -> None:
"""No lifespan, so no worker: the job waits in the table until drained."""
"""No lifespan, so no worker: the job waits in the table until drained.
`summarise_batch` is `isolate=True` in production, which runs it in a
child process that imports `desk.tools.agent` fresh and never sees the
stub below. What is under test here is the route and the queue, not
isolation itself — that has its own tests in `pipeline/tests` — so the
job runs in-thread for this one drain.
"""
from dataclasses import replace
from desk.tools import agent
from pipeline import JOBS
monkeypatch.setitem(JOBS, "summarise_batch",
replace(JOBS["summarise_batch"], isolate=False, timeout=0.0))
client = TestClient(app)
store.upsert_role(posting("1"))
store.upsert_role(posting("2"))