MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_delay_capped_at_max

Function test_delay_capped_at_max

core/src/retry.rs:298–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

delay_for_attemptMethod · 0.80

Tested by

no test coverage detected