test(cron): drop the dead RuntimeError hedge around tick() in the receipt test

tick(sync=True) collects worker futures and logs "Cron job future failed"
instead of re-raising, so the try/except RuntimeError around it could never
fire and only hid a regression that made tick() start raising. Verified the
test passes without it (fold finding 2).
This commit is contained in:
kshitijk4poor
2026-10-06 10:07:47 +05:30
committed by kshitij
parent f51a864111
commit 7dcd6353cc

View File

@@ -142,10 +142,7 @@ def test_dispatch_failure_after_receipt_never_leaves_it_claimed(cron_store, monk
monkeypatch.setattr(scheduler, "run_one_job", lambda job, **k: True)
monkeypatch.setattr(scheduler, "_should_yield_tick_to_fresh_gateway", lambda: None)
monkeypatch.setattr(scheduler, site, boom)
try:
scheduler.tick(verbose=False, sync=True)
except RuntimeError:
pass # a claim failure may still surface; the receipt is what must be terminal
scheduler.tick(verbose=False, sync=True) # a worker failure is logged, never raised
row = executions.latest_execution("due-job")
assert row is not None and row["status"] == "failed"
if site == "note_cron_execution": # the receipt exists, so creation did not fail