← ClaudeAtlas

cron-job-test-authorlisted

Use when cron jobs, Kubernetes CronJobs, BullMQ repeat jobs, Sidekiq schedules or any time-based job need tests: cron expression validation, DST and leap-day edge cases, catch-up after downtime, overlapping-run locks with stale-lock recovery, and time zones.
testland/qa · ★ 13 · Testing & QA · score 80
Install: claude install-skill testland/qa
# cron-job-test-author ## Overview Cron jobs are universally underspecified. Most teams ship cron expressions, never test them, and discover bugs when DST or a leap day rolls around. This skill is a **build-an-X workflow** for authoring cron-job tests - a checklist + per-pattern test recipes, not a single tool. ## When to use - Authoring or reviewing tests for any time-scheduled job: - Unix cron (crontab) - Kubernetes CronJobs (`apiVersion: batch/v1`) - BullMQ `repeat` jobs (Step 6 of `bullmq-tests`) - Sidekiq schedulers (sidekiq-cron, sidekiq-scheduler gems) - APScheduler (Python) - Quartz (Java) - Hangfire (.NET) ## How to use 1. List every time-scheduled job in scope (crontab, Kubernetes CronJob, BullMQ repeat, Sidekiq, APScheduler, Quartz, Hangfire). 2. Validate each cron expression with `croniter` (or a language-native validator), parametrizing known-good and known-bad expressions (Step 1). 3. For any job near a DST transition or a leap day, compute next-run times with `croniter` against `zoneinfo` and assert them (Step 2). 4. Decide and test the missed-execution policy for downtime - Unix drop, k8s `startingDeadlineSeconds`, BullMQ drop (Step 3). 5. Add overlap and stale-lock protection with a lock, and test both (Steps 4 - 5, [references/lock-patterns.md](references/lock-patterns.md)). 6. Assert timezone semantics explicitly via `croniter(..., tz=...)` or k8s `.spec.timeZone` (Step 6). 7. Run the end-to-end recipe checklist per job