consensus-raft/src/test/java/com/mboysan/consensus/RaftNodeTest.java
/**
     * Tests if a follower node is down, the system is still operational.
     */
Tests if a follower node is down, the system is still operational.
Tests if a follower node is down the system is still operational .
@Test
    void testFollowerFailure() throws Exception {
        int numServers = 3;
        init(numServers);
        int leaderId = assertOneLeader();
        kill((leaderId + 1) % numServers);
        List<String> expectedCommands = List.of("cmd0");
        assertTrue(getNode(leaderId).append(expectedCommands.get(0)).get());
        revive((leaderId + 1) % numServers);
        advanceTimeForElections();  
        assertLeaderNotChanged(leaderId);
        assertLogsEquals(expectedCommands);
    }
@ Test void testFollowerFailure ( ) throws Exception { int numServers = 3 ; init ( numServers ) ; int leaderId = assertOneLeader ( ) ; kill ( ( leaderId + 1 ) % numServers ) ; List < String > expectedCommands = List . of ( "cmd0" ) ; assertTrue ( getNode ( leaderId ) . append ( expectedCommands . get ( 0 ) ) . get ( ) ) ; revive ( ( leaderId + 1 ) % numServers ) ; advanceTimeForElections ( ) ; assertLeaderNotChanged ( leaderId ) ; assertLogsEquals ( expectedCommands ) ; }
Tests if a follower node is down, the system is still operational.
Tests if a follower node is down the system is still operational .
// allow sync time