Skip to content

Commit

Permalink
Merge pull request #150 from Neptune-Crypto/thv/fix-block-timestamp-t…
Browse files Browse the repository at this point in the history
…est-flakyness

Fix flakyness of block timestamp test
  • Loading branch information
Sword-Smith authored May 16, 2024
2 parents e215cb0 + d1e8e74 commit 4ba81ff
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 4ba81ff

Please sign in to comment.