diff --git a/crates/cli/src/alerts/tests/history.rs b/crates/cli/src/alerts/tests/history.rs index 2235e2fd..1f1b14c7 100644 --- a/crates/cli/src/alerts/tests/history.rs +++ b/crates/cli/src/alerts/tests/history.rs @@ -35,6 +35,8 @@ fn when_history_has_expired_then_message_is_passed() { let result = history.sendable(user_notification); let_assert!(Some(user_notification) = result); + std::thread::sleep(dur); + // twice the expiry duration to avoid things happening in the wrong order std::thread::sleep(dur); // after dur, message has expired, so is still valid