Skip to content

Commit 210ea20

Browse files
committed
IS-1426 add block number limit for tests
1 parent 9e5daca commit 210ea20

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/e2e/RestartBootstrapTests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static constexpr uint64_t SNAPSHOT_WAIT_TIMEOUT_MS = 20000;
4444
static constexpr uint64_t SNAPSHOT_POLL_INTERVAL_MS = 250;
4545
static constexpr uint64_t POST_PATCH_SETTLE_MS = 1500;
4646
static constexpr uint64_t REPLAY_WAIT_TIMEOUT_MS = 10000;
47+
static constexpr uint64_t MAX_PRE_RESTART_BLOCKS = 100;
4748

4849
struct BlockSnapshot {
4950
uint64_t blockId = 0;
@@ -180,6 +181,12 @@ std::vector< BlockSnapshot > waitForCommittedSnapshots(
180181
auto lastId = (uint64_t) _engine.getLargestCommittedBlockIDInDb();
181182
auto elapsedMs = Time::getCurrentTimeMs() - startTimeMs;
182183

184+
// set max limit of blocks - consensus limits max skaled-consensus delay to be
185+
// 128 blocks
186+
if ( lastId >= MAX_PRE_RESTART_BLOCKS ) {
187+
return buildSnapshots( _engine, MAX_PRE_RESTART_BLOCKS );
188+
}
189+
183190
// if passed minimum wait time
184191
if ( elapsedMs >= _minWaitMs && lastId > 0 ) {
185192
auto snapshots = buildSnapshots( _engine, lastId );

0 commit comments

Comments
 (0)