You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/06/03 17:05:38 UTC

[GitHub] [ignite-3] sashapolo commented on a diff in pull request #853: IGNITE-17100 Make JoinReady command idempotent

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


##########
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:
   I just wanted to verify that there's no state behind the start, so I execute the completion phase 1 time more



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org