diff --git a/tests/common/util/TestObject.cpp b/tests/common/util/TestObject.cpp index f04149e6..664f7438 100644 --- a/tests/common/util/TestObject.cpp +++ b/tests/common/util/TestObject.cpp @@ -89,6 +89,8 @@ createLedgerHeader(std::string_view ledgerHash, ripple::LedgerIndex seq, std::op ledgerHeader.seq = seq; if (age) { + // Note: be cautious of using age values close to each other as the underlying NetClock precision is seconds + // and the small time difference may lead to comparison bugs auto const now = duration_cast(system_clock::now().time_since_epoch()); auto const closeTime = (now - seconds{age.value()}).count() - kRIPPLE_EPOCH_START; ledgerHeader.closeTime = ripple::NetClock::time_point{seconds{closeTime}}; diff --git a/tests/unit/etlng/ExtractionTests.cpp b/tests/unit/etlng/ExtractionTests.cpp index 9d50784b..3f983bff 100644 --- a/tests/unit/etlng/ExtractionTests.cpp +++ b/tests/unit/etlng/ExtractionTests.cpp @@ -92,7 +92,7 @@ TEST_F(ExtractionModelNgTests, LedgerDataCopyableAndEquatable) } { auto third = second; - third.header = createLedgerHeader(kLEDGER_HASH2, kSEQ, 2); + third.header = createLedgerHeader(kLEDGER_HASH2, kSEQ, 100); // Using large age value to avoid flaky test EXPECT_NE(first, third); } {