mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
partial bitcoin#27405: Use steady clock instead of system clock to measure durations
includes: - fa1d8044abc2cd0f149a2d526b3b03441443cdb0
This commit is contained in:
parent
1e609cff61
commit
a9e3b9f2db
@ -141,10 +141,10 @@ BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, BuildChainTestingSetup)
|
||||
BOOST_REQUIRE(filter_index.Start(::ChainstateActive()));
|
||||
|
||||
// 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});
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,10 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
|
||||
BOOST_REQUIRE(txindex.Start(::ChainstateActive()));
|
||||
|
||||
// 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});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user