sashapolo commented on code in PR #1397:
URL: https://github.com/apache/ignite-3/pull/1397#discussion_r1043043517


##########
modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLearnersTest.java:
##########
@@ -273,20 +292,120 @@ public void testLostLearners() throws Exception {
         
assertThat(services.get(0).thenCompose(RaftGroupService::refreshLeader), 
willCompleteSuccessfully());
     }
 
+    /**
+     * Tests a situation when a peer and a learner are started on the same 
node.
+     */
+    @Test
+    void testLearnersOnTheSameNodeAsPeers() throws InterruptedException {
+        RaftNode node = nodes.get(0);
+
+        PeersAndLearners configuration = createConfiguration(List.of(node), 
List.of(node));
+
+        var peerListener = new TestRaftGroupListener();
+        var learnerListener = new TestRaftGroupListener();
+
+        Peer peer = configuration.peer(node.consistentId());
+        Peer learner = configuration.learner(node.consistentId());
+
+        CompletableFuture<RaftGroupService> peerService = startRaftGroup(node, 
peer, configuration, peerListener);
+        CompletableFuture<RaftGroupService> learnerService = 
startRaftGroup(node, learner, configuration, learnerListener);
+
+        assertThat(peerService.thenApply(RaftGroupService::leader), 
willBe(peer));
+        assertThat(peerService.thenApply(RaftGroupService::leader), 
willBe(not(learner)));

Review Comment:
   It's just a sanity check that peer is not equal to the learner



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to