From 567d53db23f4b1393f3d26fb6fa0a77966fa487d Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 7 Sep 2026 03:50:11 -0700 Subject: [PATCH] test: use an isolated real ledger for Chronos claim rearming --- tests/plugins/test_chronos_cron.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/plugins/test_chronos_cron.py b/tests/plugins/test_chronos_cron.py index a98ad24628..97486632bf 100644 --- a/tests/plugins/test_chronos_cron.py +++ b/tests/plugins/test_chronos_cron.py @@ -136,8 +136,11 @@ def test_fire_due_rearms_next_oneshot(chronos, monkeypatch): assert fake.provisions[0]["fire_at"] == "2026-06-18T12:05:00+00:00" -def test_fire_due_rearms_after_claimed_job_failure(chronos, monkeypatch): +def test_fire_due_rearms_after_claimed_job_failure(chronos, monkeypatch, tmp_path): """A claimed attempt is consumed even when the job pipeline reports failure.""" + import cron.executions as executions + + monkeypatch.setattr(executions, "EXECUTIONS_FILE", tmp_path / "executions.db") prov, fake = chronos claimed = {"id": "j1", "fire_claim": {"by": "owner-1"}} persisted = { @@ -147,10 +150,6 @@ def test_fire_due_rearms_after_claimed_job_failure(chronos, monkeypatch): } monkeypatch.setattr("cron.jobs.claim_job_for_fire", lambda jid, **kw: claimed) - monkeypatch.setattr( - "cron.executions.create_execution", - lambda jid, source: {"id": "exec-1"}, - ) monkeypatch.setattr("cron.scheduler.run_one_job", lambda *args, **kwargs: False) monkeypatch.setattr("cron.jobs.get_job", lambda jid: persisted)