Fix bugs in retry delays less than a second and retries leading to too many countdowns
Add tests for countdown