mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
test: Use same timeout for all index sync
This commit is contained in:
@@ -6,28 +6,15 @@
|
||||
#include <index/coinstatsindex.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <kernel/coinstats.h>
|
||||
#include <test/util/index.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <test/util/validation.h>
|
||||
#include <util/time.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(coinstatsindex_tests)
|
||||
|
||||
static void IndexWaitSynced(BaseIndex& index)
|
||||
{
|
||||
// Allow the CoinStatsIndex to catch up with the block index that is syncing
|
||||
// in a background thread.
|
||||
const auto timeout = GetTime<std::chrono::seconds>() + 120s;
|
||||
while (!index.BlockUntilSyncedToCurrentChain()) {
|
||||
BOOST_REQUIRE(timeout > GetTime<std::chrono::milliseconds>());
|
||||
UninterruptibleSleep(100ms);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
|
||||
{
|
||||
CoinStatsIndex coin_stats_index{interfaces::MakeChain(m_node), 1 << 20, true};
|
||||
|
||||
Reference in New Issue
Block a user