nats nak w/ shared retry_backoff, exhausted log; no 'will retry' lie
This commit is contained in:
@@ -53,3 +53,13 @@ fn follow_requested_with_handle() {
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retry_backoff_doubles_from_ten_seconds_and_caps_at_five_minutes() {
|
||||
use domain::events::retry_backoff;
|
||||
use std::time::Duration;
|
||||
let secs: Vec<u64> = (1..=8).map(|n| retry_backoff(n).as_secs()).collect();
|
||||
assert_eq!(secs, [10, 20, 40, 80, 160, 300, 300, 300]);
|
||||
assert_eq!(retry_backoff(0), Duration::from_secs(5));
|
||||
assert_eq!(retry_backoff(u32::MAX), Duration::from_secs(300));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user