()
| 296 | |
| 297 | #[test] |
| 298 | fn test_delay_capped_at_max() { |
| 299 | let config = RetryConfig { |
| 300 | base_delay_ms: 1000, |
| 301 | max_delay_ms: 5000, |
| 302 | ..Default::default() |
| 303 | }; |
| 304 | |
| 305 | // Attempt 10 would be 1024s without cap, should be capped at 5s |
| 306 | let d = config.delay_for_attempt(10); |
| 307 | assert!(d.as_millis() <= 6250); // 5000 + 25% jitter |
| 308 | } |
| 309 | |
| 310 | #[test] |
| 311 | fn test_delay_zero_base() { |
nothing calls this directly
no test coverage detected