use of org.junit.jupiter.api.condition.EnabledForJreRange in project Aeron by real-logic.
the class FailedFirstElectionClusterTest method shouldRecoverWhenFollowerIsMultipleTermsBehindFromEmptyLog.
@Test
@EnabledForJreRange(min = JRE.JAVA_11)
@InterruptAfter(60)
public void shouldRecoverWhenFollowerIsMultipleTermsBehindFromEmptyLog() {
final int numNodes = 3;
final int messageCount = 10;
final int numTerms = 3;
final TestCluster cluster = aCluster().withStaticNodes(numNodes).start(2);
systemTestWatcher.cluster(cluster);
systemTestWatcher.ignoreErrorsMatching((s) -> s.contains("Forced failure"));
int totalMessages = 0;
for (int i = 0; i < numTerms; i++) {
final TestNode oldLeader = cluster.awaitLeader();
cluster.connectClient();
cluster.sendMessages(messageCount);
totalMessages += messageCount;
cluster.awaitResponseMessageCount(totalMessages);
cluster.stopNode(oldLeader);
cluster.startStaticNode(oldLeader.index(), false);
cluster.awaitLeader();
}
cluster.startStaticNode(2, true);
cluster.connectClient();
cluster.sendMessages(messageCount);
totalMessages += messageCount;
cluster.awaitResponseMessageCount(totalMessages);
cluster.awaitServicesMessageCount(totalMessages);
cluster.assertRecordingLogsEqual();
}
Aggregations