Search in sources :

Example 6 with EnabledForJreRange

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();
}
Also used : TestCluster(io.aeron.test.cluster.TestCluster) TestNode(io.aeron.test.cluster.TestNode) EnabledForJreRange(org.junit.jupiter.api.condition.EnabledForJreRange) SlowTest(io.aeron.test.SlowTest) Test(org.junit.jupiter.api.Test) InterruptAfter(io.aeron.test.InterruptAfter)

Aggregations

EnabledForJreRange (org.junit.jupiter.api.condition.EnabledForJreRange)6 Test (org.junit.jupiter.api.Test)5 InterruptAfter (io.aeron.test.InterruptAfter)2 SlowTest (io.aeron.test.SlowTest)2 TestCluster (io.aeron.test.cluster.TestCluster)2 TestNode (io.aeron.test.cluster.TestNode)2 File (java.io.File)2 FileWriter (java.io.FileWriter)2 PrintWriter (java.io.PrintWriter)2 ConfigurationMetadata (org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata)2 Reader (java.io.Reader)1 Path (java.nio.file.Path)1 Compilable (javax.script.Compilable)1 ScriptEngineManager (javax.script.ScriptEngineManager)1 DateTime (org.joda.time.DateTime)1 LocalDate (org.joda.time.LocalDate)1 LocalDateTime (org.joda.time.LocalDateTime)1 LocalTime (org.joda.time.LocalTime)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1