fix(issue-50, issue-55): onboarding and dispatch wait by the registry, one pane claim per server; tests stay out of the real agent homes #56
No files matched your search
@@ -297,9 +297,11 @@ def open_jobs(registry_dir: str, session: str, job_id: str, now: Optional[int] =
|
||||
rec = _load_record(registry_dir, other)
|
||||
if rec is None or _bare(str(rec.get("agent_session") or "")) != sess:
|
||||
continue
|
||||
if rec.get("dry_run"): # a submit --dry-run is never dispatched (review 1e25cf2f F1)
|
||||
continue
|
||||
status = rec.get("status")
|
||||
# a submit --dry-run is never dispatched (review 1e25cf2f F1); once a
|
||||
# pick-pending claims it, it is running work like any other (211037ab F1)
|
||||
if rec.get("dry_run") and status == "pending":
|
||||
continue
|
||||
if status == "running":
|
||||
idle = _int_field(rec, "idle_timeout_sec", DEFAULT_IDLE_TIMEOUT_SEC)
|
||||
if recent_disk_heartbeat(registry_dir, other, idle):
|
||||
|
||||
@@ -174,8 +174,12 @@ def test_u1e_a_dry_run_record_is_not_an_open_job(tmp_path):
|
||||
me = _register(reg)
|
||||
assert decide.open_jobs(str(reg), "herdr:s", me) == ([], [])
|
||||
assert decide.wait_open_jobs(_ns(reg, me)) == "clear"
|
||||
# control: the same record without the mark is an `injected` job that holds the session
|
||||
_edit(reg, dry, dry_run=None)
|
||||
# claimed by a pick-pending and started, it is running work (review 211037ab F1)
|
||||
_edit(reg, dry, status="running")
|
||||
_event(reg, dry, time.time(), event="started")
|
||||
assert decide.wait_open_jobs(_ns(reg, me)) == f"busy {dry}"
|
||||
# control: the pending record without the mark is an `injected` job that holds the session
|
||||
_edit(reg, dry, status="pending", dry_run=None)
|
||||
assert decide.wait_open_jobs(_ns(reg, me)) == f"busy {dry}"
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user