diff --git a/crates/iota-e2e-tests/tests/shared_objects_tests.rs b/crates/iota-e2e-tests/tests/shared_objects_tests.rs index 1db547c9b38..a426df74644 100644 --- a/crates/iota-e2e-tests/tests/shared_objects_tests.rs +++ b/crates/iota-e2e-tests/tests/shared_objects_tests.rs @@ -470,6 +470,8 @@ async fn call_shared_object_contract() { #[sim_test] async fn access_clock_object_test() { + // Permitted timestamp tolerance for calculating potential time delay + let timestamp_tolerance_ms: u64 = 10; let test_cluster = TestClusterBuilder::new().build().await; let package_id = publish_basics_package(&test_cluster.wallet).await.0; @@ -536,7 +538,10 @@ async fn access_clock_object_test() { // Timestamp that we have read in a smart contract // should match timestamp of the checkpoint where transaction is included - assert_eq!(checkpoint.timestamp_ms, event.timestamp_ms); + assert!((checkpoint.timestamp_ms as i64 - event.timestamp_ms as i64).abs() <= timestamp_tolerance_ms as i64, + "timestamps are not within the allowed tolerance. Checkpoint: {}, Event: {}", + checkpoint.timestamp_ms, + event.timestamp_ms); break; } }