mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge bitcoin/bitcoin#28036: test: Restore unlimited timeout in IndexWaitSynced
fabed7eb796637c02e3677ebbe183d90b258ba69 test: Restore unlimited timeout in IndexWaitSynced (MarcoFalke) Pull request description: The timeout was unlimited before, so just restore that value for now: https://github.com/bitcoin/bitcoin/pull/27988#issuecomment-1619218007 . (Strictly speaking, this is a behavior change for the blockfilterindex and txindex tests, because it only restores the coinstatsindex behavior.) ACKs for top commit: ajtowns: utACK fabed7eb796637c02e3677ebbe183d90b258ba69 mzumsande: ACK fabed7eb796637c02e3677ebbe183d90b258ba69 furszy: ACK fabed7eb Tree-SHA512: 66a878be58bbe53ad8e0c23f05569dd42df688be747551fbd202ada22d20a8285714e58fa2a71664deadb070ddf86cfad88c01042ff95ed26f6b40e4a10cec0a
This commit is contained in:
parent
2767a13268
commit
551109105a
@ -5,14 +5,11 @@
|
|||||||
#include <test/util/index.h>
|
#include <test/util/index.h>
|
||||||
|
|
||||||
#include <index/base.h>
|
#include <index/base.h>
|
||||||
#include <util/check.h>
|
|
||||||
#include <util/time.h>
|
#include <util/time.h>
|
||||||
|
|
||||||
void IndexWaitSynced(BaseIndex& index)
|
void IndexWaitSynced(const BaseIndex& index)
|
||||||
{
|
{
|
||||||
const auto timeout{SteadyClock::now() + 120s};
|
|
||||||
while (!index.BlockUntilSyncedToCurrentChain()) {
|
while (!index.BlockUntilSyncedToCurrentChain()) {
|
||||||
Assert(timeout > SteadyClock::now());
|
|
||||||
UninterruptibleSleep(100ms);
|
UninterruptibleSleep(100ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,6 @@
|
|||||||
class BaseIndex;
|
class BaseIndex;
|
||||||
|
|
||||||
/** Block until the index is synced to the current chain */
|
/** Block until the index is synced to the current chain */
|
||||||
void IndexWaitSynced(BaseIndex& index);
|
void IndexWaitSynced(const BaseIndex& index);
|
||||||
|
|
||||||
#endif // BITCOIN_TEST_UTIL_INDEX_H
|
#endif // BITCOIN_TEST_UTIL_INDEX_H
|
||||||
|
Loading…
Reference in New Issue
Block a user