debuggingpractice
Use a controllable clock in time-based tests
Anonymous
Tests for expiry, cooldowns, or backoff are easier to reason about when the clock can be advanced directly. That avoids waiting in real time and makes boundary cases repeatable. Keep the clock interface narrow so ordinary code does not gain unnecessary time-related complexity.
0