Files
periscope/tests/test_job_runner.py
T
micheleandCursor 96e2590a3c Detect a dead local pipeline worker after API restart, and flush SSE.
A docker rebuild left HubAudio status=running with no process, so the UI sat on a silent event stream. Persist the worker pid and disable proxy buffering on the SSE response.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-28 08:50:33 +02:00

12 lines
461 B
Python

"""Local worker pid file so a restarted API can see a dead subprocess."""
from backend.services import job_runner
def test_local_state_failed_when_pid_file_is_stale(tmp_path, monkeypatch):
monkeypatch.setattr(job_runner.settings, "data_dir", tmp_path)
pid_path = tmp_path / "workers" / "proj.pid"
pid_path.parent.mkdir(parents=True)
pid_path.write_text("99999999")
assert job_runner.get_execution_state("local/projects/proj") == "failed"