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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItAddNodeTest.java:
##########
@@ -38,63 +27,29 @@
 /**
  * Integration tests for testing simple node join scenarios.
  */
-public class ItAddNodeTest extends IgniteAbstractTest {
-    private static final String NODE_CONFIG_TEMPLATE
-            = "ignite.network.nodeFinder.netClusterNodes = [\"localhost:" + 
DEFAULT_PORT + "\"]\n"
-            + "ignite.network.port = %d\n"
-            + "ignite.rest.port = %d\n";
+public class ItAddNodeTest extends ClusterPerTestIntegrationTest {
+    @Override
+    protected int initialNodes() {
+        return 0;
+    }
 
     /**
      * Test that shows that we can join a third node to a cluster of two.
      */
     @Test
     public void addOneNodeToTwoNodeCluster(TestInfo testInfo) throws Exception 
{
-        int numberOfNodesInitially = 2;
-
-        List<IgniteServer> nodes = new ArrayList<>();
-
-        try {
-            for (int i = 0; i < numberOfNodesInitially; i++) {
-                String nodeName = testNodeName(testInfo, i);
-
-                IgniteServer node = TestIgnitionManager.start(
-                        nodeName,
-                        String.format(NODE_CONFIG_TEMPLATE, DEFAULT_PORT + i, 
10300 + i),
-                        workDir.resolve(nodeName)
-                );
-
-                nodes.add(node);
-            }
+        cluster.startAndInit(2);
 
-            IgniteServer node0 = nodes.get(0);
+        Ignite ignite0 = cluster.node(0);
 
-            node0.initCluster(new InitParametersBuilder()
-                    .clusterName("clusterName")
-                    .metaStorageNodes(node0)
-                    .build()
-            );
-            assertThat(node0.waitForInitAsync(), willCompleteSuccessfully());
-
-            Ignite ignite0 = node0.api();
-
-            try (ResultSet<SqlRow> unused = ignite0.sql().execute(null, 
"CREATE TABLE " + "TEST_TABLE" + "(\n"
-                    + "    key int PRIMARY KEY,\n"
-                    + "    field1   int\n"
-                    + ")"
-            )) {
-                // No-op.
-            }
-
-            String nodeName2 = testNodeName(testInfo, numberOfNodesInitially);
-            IgniteServer node2 = TestIgnitionManager.start(
-                    nodeName2,
-                    String.format(NODE_CONFIG_TEMPLATE, DEFAULT_PORT + 
numberOfNodesInitially, 10300 + numberOfNodesInitially),
-                    workDir.resolve(nodeName2)
-            );
-
-            nodes.add(node2);
-        } finally {
-            IgniteUtils.closeAll(nodes.stream().map(node -> node::shutdown));
+        try (ResultSet<SqlRow> unused = ignite0.sql().execute(null, "CREATE 
TABLE TEST_TABLE (\n"
+                + "    key int PRIMARY KEY,\n"
+                + "    field1   int\n"
+                + ")"
+        )) {
+            // No-op.
         }
+
+        cluster.startNode(2);

Review Comment:
   ```suggestion
           assertDoesNotThrow(() -> cluster.startNode(2));
   ```



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