The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(cron): stabilize heartbeat grace assertion
KoNit-Kea92bbc5c252
diff --git a/tests/cron/test_script_claim_heartbeat.py b/tests/cron/test_script_claim_heartbeat.pyindex 1903b78fff4..1b6d7f74d70 100644--- a/tests/cron/test_script_claim_heartbeat.py+++ b/tests/cron/test_script_claim_heartbeat.py@@ -647,17 +647,21 @@ def test_repeated_heartbeat_errors_cancel_after_bounded_grace(monkeypatch):import cron.scheduler as schedulerfrom cron import scheduler_script as sched_script+ last_confirmed_at = []+ cancellation_after = []calls = 0def heartbeat(*_args, **_kwargs):nonlocal callscalls += 1if calls == 1:+ last_confirmed_at.append(time.monotonic())return Trueraise OSError("store unavailable")def run_body(_job, **kwargs):assert kwargs["fire_claim_lost"].wait(timeout=0.5)+ cancellation_after.append(time.monotonic() - last_confirmed_at[0])return Truejob = {@@ -670,7 +674,7 @@ def test_repeated_heartbeat_errors_cancel_after_bounded_grace(monkeypatch):monkeypatch.setattr(scheduler, "_FIRE_CLAIM_HEARTBEAT_GRACE_SECONDS", 0.03)assert scheduler.run_one_job(job) is True- assert calls >= 3+ assert cancellation_after[0] >= scheduler._FIRE_CLAIM_HEARTBEAT_GRACE_SECONDSdef test_terminal_owner_cas_failure_marks_ledger_ownership_lost(monkeypatch):