rpuch commented on code in PR #853:
URL: https://github.com/apache/ignite-3/pull/853#discussion_r889137576


##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -471,4 +468,31 @@ void testClusterStateValidation() {
                 )
         );
     }
+
+    /**
+     * Tests that {@link JoinRequestCommand} and {@link JoinReadyCommand} are 
idempotent.
+     */
+    @Test
+    void testJoinCommandsIdempotence() {
+        ClusterState state = new ClusterState(
+                List.of("foo"),
+                List.of("bar"),
+                IgniteProductVersion.CURRENT_VERSION,
+                new ClusterTag("cluster")
+        );
+
+        assertThat(cluster.get(0).raftService.initClusterState(state), 
willCompleteSuccessfully());
+
+        CmgRaftService service = cluster.get(1).raftService;
+
+        assertThat(service.startJoinCluster(state.clusterTag()), 
willCompleteSuccessfully());
+
+        assertThat(service.startJoinCluster(state.clusterTag()), 
willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());

Review Comment:
   Why is completion tried 3 times, while start is only tried 2 times?



##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -471,4 +468,31 @@ void testClusterStateValidation() {
                 )
         );
     }
+
+    /**
+     * Tests that {@link JoinRequestCommand} and {@link JoinReadyCommand} are 
idempotent.
+     */
+    @Test
+    void testJoinCommandsIdempotence() {
+        ClusterState state = new ClusterState(
+                List.of("foo"),
+                List.of("bar"),
+                IgniteProductVersion.CURRENT_VERSION,
+                new ClusterTag("cluster")
+        );
+
+        assertThat(cluster.get(0).raftService.initClusterState(state), 
willCompleteSuccessfully());
+
+        CmgRaftService service = cluster.get(1).raftService;
+
+        assertThat(service.startJoinCluster(state.clusterTag()), 
willCompleteSuccessfully());
+
+        assertThat(service.startJoinCluster(state.clusterTag()), 
willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+    }

Review Comment:
   Does it make sense to also check how `startJoinCluster()` works AFTER 
`completeJoinCluster()`?



-- 
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