Skip to content

Commit

Permalink
Fix flakyness of block timestamp test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sword-Smith committed May 10, 2024
1 parent f1b3d57 commit d1e8e74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mine_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit d1e8e74

Please sign in to comment.