From 5733ec097bfbb87e36e9ee83a01ecb6679ee691f Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 14 Aug 2026 20:58:37 -0700 Subject: [PATCH] test(cron): adapt guard-leak regression to owner-fenced dispatch on main The salvaged regression from #86582 predates the claim_job_for_fire owner-fencing that landed with #70638; mock the claim and heartbeat so the healthy job actually runs through the fenced flow. --- tests/cron/test_parallel_pool.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/cron/test_parallel_pool.py b/tests/cron/test_parallel_pool.py index 70c3b3b16d..9cdbf0a035 100644 --- a/tests/cron/test_parallel_pool.py +++ b/tests/cron/test_parallel_pool.py @@ -178,7 +178,17 @@ class TestRunningJobGuard: monkeypatch.setattr(sched, "_deliver_result", lambda *_a, **_kw: None) monkeypatch.setattr(sched, "finish_execution", lambda *_a, **_kw: None) monkeypatch.setattr(sched, "claim_dispatch", lambda *_a, **_kw: True) + monkeypatch.setattr( + sched, + "claim_job_for_fire", + lambda job_id, **_kw: dict( + healthy_job, fire_claim={"by": "test-owner", "at": "now"} + ) + if job_id == "healthy-job" + else None, + ) monkeypatch.setattr(sched, "mark_execution_running", lambda *_a, **_kw: None) + monkeypatch.setattr(sched, "heartbeat_fire_claim", lambda *_a, **_kw: True) n = sched.tick(verbose=False)