From 443748889984fa8789b0203a6fe8e1fa0fe08040 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 24 May 2026 12:40:27 -0400 Subject: [PATCH] fix(tests): unpin test_recover_interrupted_only_old from STUCK_THRESHOLD_MINUTES (was -5min fresh / now -30sec so threshold can move freely) Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_maintenance.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_maintenance.py b/tests/test_maintenance.py index f580916..1484b77 100644 --- a/tests/test_maintenance.py +++ b/tests/test_maintenance.py @@ -30,9 +30,14 @@ def test_recover_interrupted_only_old(db_sync, monkeypatch): batch_id = _make_batch(db_sync) now = datetime.now(UTC) + # "Fresh" must sit comfortably under whatever STUCK_THRESHOLD_MINUTES + # currently is (5 min as of 2026-05-24, tightened from 30); 30 + # seconds is well below any reasonable threshold. "Stale" stays at + # 2 hours so the test remains valid if the threshold ever moves + # back up. fresh = ImportTask( batch_id=batch_id, source_path="/import/a.jpg", task_type="media", - status="processing", started_at=now - timedelta(minutes=5), + status="processing", started_at=now - timedelta(seconds=30), ) stale = ImportTask( batch_id=batch_id, source_path="/import/b.jpg", task_type="media",