test(cron): unreachable-retry ladder test uses an interval schedule, not a wall-clock cron

"0 3 * * *" fires at a fixed UTC minute; when CI runs in the half hour before
it (observed 02:30:56Z), the 30-minute rung lands after the natural occurrence
and plan_retry correctly yields to the schedule, clearing the state the test
asserts on. "every 24h" always has its natural fire a full day out, so every
rung is strictly earlier regardless of when the test runs.
This commit is contained in:
teknium1
2026-09-12 20:09:55 -07:00
committed by Teknium
parent ec58e08a35
commit ae38c903b1

View File

@@ -29,7 +29,10 @@ def _iso(dt: datetime) -> str:
def test_unreachable_failure_pulls_next_run_earlier_then_ladder_exhausts(tmp_cron_home):
"""Failed-unreachable runs re-fire on the 5/15/30-minute ladder instead of waiting a
full period, and the ladder stops after its last rung (falls back to the schedule)."""
job = create_job("nightly report", "0 3 * * *") # daily — natural gap is hours
# Interval, not a cron expression: the natural next fire is always a full day out. A
# fixed clock time ("0 3 * * *") makes the 30-minute rung land past the natural fire
# in the half hour before it, and plan_retry rightly yields to the schedule (CI red).
job = create_job("nightly report", "every 24h")
job_id = job["id"]
now = datetime.now(timezone.utc)