From d1e8e744011de5f21f4ee6f8ed323dcd47ae84c4 Mon Sep 17 00:00:00 2001 From: Thorkil Vaerge Date: Fri, 10 May 2024 12:43:30 +0200 Subject: [PATCH] Fix flakyness of block timestamp test --- src/mine_loop.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mine_loop.rs b/src/mine_loop.rs index 23e207f3..c985c79a 100644 --- a/src/mine_loop.rs +++ b/src/mine_loop.rs @@ -719,11 +719,11 @@ mod mine_loop_tests { let block_timestamp = mined_block_info.block.kernel.header.timestamp; - assert!(block_timestamp > initial_header_timestamp); - assert!(block_timestamp < Timestamp::now()); + assert!(block_timestamp >= initial_header_timestamp); + assert!(block_timestamp <= Timestamp::now()); - // verify timestamp is within the last second. - assert!(Timestamp::now() - block_timestamp < Timestamp::seconds(1)); + // verify timestamp is within the last 100 seconds (allows for some CI slack). + assert!(Timestamp::now() - block_timestamp < Timestamp::seconds(100)); Ok(()) }