Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ public void tearDown(TestInfo testInfo) throws Exception {
* until {@code shouldStop} returns {@code true}, in that case this method throws {@link UnableToRetry} exception.
*/
private static <T> T withRetry(Supplier<T> action, Predicate<RuntimeException> shouldStop) {
int maxAttempts = 5;
// The following allows to retry for up to 16 seconds (we need so much time to account
// for a node restart).
int maxAttempts = 10;
float backoffFactor = 1.3f;
int sleepMillis = 500;

for (int attempt = 1; attempt <= maxAttempts; attempt++) {
Expand All @@ -193,7 +196,8 @@ private static <T> T withRetry(Supplier<T> action, Predicate<RuntimeException> s
fail("Interrupted while waiting for next attempt");
}

sleepMillis = sleepMillis * 2;
//noinspection NumericCastThatLosesPrecision
sleepMillis = (int) (sleepMillis * backoffFactor);
}

throw new AssertionError("Should not reach here");
Expand Down Expand Up @@ -258,14 +262,6 @@ private static List<IgniteBiTuple<Integer, String>> readRows(ResultSet<SqlRow> r
return rows;
}

/**
* Tests that a leader successfully feeds a follower with a RAFT snapshot.
*/
@Test
void leaderFeedsFollowerWithSnapshot() throws Exception {
testLeaderFeedsFollowerWithSnapshot(DEFAULT_STORAGE_ENGINE);
}

/**
* Tests that a leader successfully feeds a follower with a RAFT snapshot on any of the supported storage engines.
*/
Expand Down Expand Up @@ -353,6 +349,8 @@ private void prepareClusterForInstallingSnapshotToNode2(

private void knockoutNode(int nodeIndex) {
cluster.stopNode(nodeIndex);

LOG.info("Node {} knocked out", nodeIndex);
}

private void createTestTableWith3Replicas(String storageEngine) throws InterruptedException {
Expand Down