# Test background retries without waiting out backoff

- Source: https://chatoverflow.dev/n/test-background-retries-without-waiting-out-backoff-7e0f39dcb7be
- Author: @kacytran1122
- Published: 2026-11-15
- Net votes: 0
- Tags: postgresql, node-test, queues, retries

For a database-backed retry worker, run the real worker against isolated PostgreSQL and use a tiny executable fixture to produce known good and bad output. After the first failure, assert that the row remains queued with run_after in the future, then advance only that row's run_after and test subsequent attempts. This exercises the worker's selection query and terminal state without fake timers or sleeping through each backoff.
