test: Use steady clock in index tests
This commit is contained in:
2 files changed
+6
-6
No files matched your search
@@ -141,10 +141,10 @@ BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, BuildChainTestingSetup)
|
||||
BOOST_REQUIRE(filter_index.Start());
|
||||
|
||||
// Allow filter index to catch up with the block index.
|
||||
constexpr int64_t timeout_ms = 10 * 1000;
|
||||
int64_t time_start = GetTimeMillis();
|
||||
constexpr auto timeout{10s};
|
||||
const auto time_start{SteadyClock::now()};
|
||||
while (!filter_index.BlockUntilSyncedToCurrentChain()) {
|
||||
BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis());
|
||||
BOOST_REQUIRE(time_start + timeout > SteadyClock::now());
|
||||
UninterruptibleSleep(std::chrono::milliseconds{100});
|
||||
}
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
|
||||
BOOST_REQUIRE(txindex.Start());
|
||||
|
||||
// Allow tx index to catch up with the block index.
|
||||
constexpr int64_t timeout_ms = 10 * 1000;
|
||||
int64_t time_start = GetTimeMillis();
|
||||
constexpr auto timeout{10s};
|
||||
const auto time_start{SteadyClock::now()};
|
||||
while (!txindex.BlockUntilSyncedToCurrentChain()) {
|
||||
BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis());
|
||||
BOOST_REQUIRE(time_start + timeout > SteadyClock::now());
|
||||
UninterruptibleSleep(std::chrono::milliseconds{100});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user