From 864833d23226716bd2b673f2102eb24fc01eb629 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 17 Oct 2024 20:28:32 +0000 Subject: [PATCH] fix: increase MAX_SECONDS_TO_LEND_FROM_FUTURE to 30 5 seconds is easy to exhaust by running securejoin, especially when it happens in automatic tests. This may however easily affect bots as well. --- src/timesmearing.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/timesmearing.rs b/src/timesmearing.rs index 6bd4dbbba..6edb85834 100644 --- a/src/timesmearing.rs +++ b/src/timesmearing.rs @@ -17,7 +17,7 @@ use std::cmp::{max, min}; use std::sync::atomic::{AtomicI64, Ordering}; -pub(crate) const MAX_SECONDS_TO_LEND_FROM_FUTURE: i64 = 5; +pub(crate) const MAX_SECONDS_TO_LEND_FROM_FUTURE: i64 = 30; /// Smeared timestamp generator. #[derive(Debug)] @@ -157,11 +157,11 @@ mod tests { // because there were not enough timestamps in the past. assert_eq!(smeared_timestamp.current(), now + 4); - // Forward another 7 messages. - // We cannot use more than 5 timestamps from the future, - // so we use 5 timestamps from the future, + // Forward another 32 messages. + // We cannot use more than 30 timestamps from the future, + // so we use 30 timestamps from the future, // the current timestamp and one timestamp from the past. - assert_eq!(smeared_timestamp.create_n(now, forwarded_messages), now - 1); + assert_eq!(smeared_timestamp.create_n(now, 32), now - 1); } #[tokio::test(flavor = "multi_thread", worker_threads = 2)]