consensus-bizur/src/test/java/com/mboysan/consensus/BizurNodeTest.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);
        Map<String, String> expectedKVs = new HashMap<>() {{
            put("k0", "v0");
            put("k1", "v1");
        }};
        getNode(leaderId).set("k0", "v0").get();
        revive((leaderId + 1) % numServers);
        getNode(leaderId).set("k1", "v1").get();
        assertLeaderNotChanged(leaderId);
        assertBucketMapsEquals(expectedKVs);
    }
@ Test void testFollowerFailure ( ) throws Exception { int numServers = 3 ; init ( numServers ) ; int leaderId = assertOneLeader ( ) ; kill ( ( leaderId + 1 ) % numServers ) ; Map < String , String > expectedKVs = new HashMap < > ( ) { { put ( "k0" , "v0" ) ; put ( "k1" , "v1" ) ; } } ; getNode ( leaderId ) . set ( "k0" , "v0" ) . get ( ) ; revive ( ( leaderId + 1 ) % numServers ) ; getNode ( leaderId ) . set ( "k1" , "v1" ) . get ( ) ; assertLeaderNotChanged ( leaderId ) ; assertBucketMapsEquals ( expectedKVs ) ; }
Tests if a follower node is down, the system is still operational.
Tests if a follower node is down the system is still operational .
// sync: Bizur triggers bucket sync as soon as a set operation is performed by the leader.