mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
test: Restore unlimited timeout in IndexWaitSynced
The timeout was unlimited before, so just restore that value for now: https://github.com/bitcoin/bitcoin/pull/27988#issuecomment-1619218007
This commit is contained in:
parent
bc4f6b13fe
commit
fabed7eb79
2 changed files with 2 additions and 5 deletions
|
@ -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 a new issue