sanpwc commented on a change in pull request #642:
URL: https://github.com/apache/ignite-3/pull/642#discussion_r838217445



##########
File path: 
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
##########
@@ -140,31 +582,357 @@ public void twoCustomPropertiesTest(TestInfo testInfo) {
                 new String[]{"localhost:3344", "localhost:3343"},
                 
ignite.nodeConfiguration().getConfiguration(NetworkConfiguration.KEY).nodeFinder().netClusterNodes().value()
         );
-
-        IgnitionManager.stop(ignite.name());
     }
 
     /**
      * Restarts the node which stores some data.
      */
     @Test
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-16433";)
     public void nodeWithDataTest(TestInfo testInfo) {
-        String nodeName = testNodeName(testInfo, 3344);
-
-        Ignite ignite = IgnitionManager.start(nodeName, "{\n"
-                + "  \"node\": {\n"
-                + "    \"metastorageNodes\":[ " + nodeName + " ]\n"
-                + "  },\n"
-                + "  \"network\": {\n"
-                + "    \"port\":3344,\n"
-                + "    \"nodeFinder\": {\n"
-                + "      \"netClusterNodes\":[ \"localhost:3344\" ] \n"
-                + "    }\n"
-                + "  }\n"
-                + "}", workDir);
-
-        TableDefinition scmTbl1 = SchemaBuilders.tableBuilder("PUBLIC", 
TABLE_NAME).columns(
+        Ignite ignite = startNode(testInfo, 0);
+
+        createTableWithData(ignite, TABLE_NAME, 1);
+
+        stopNode(0);
+
+        ignite = startNode(testInfo, 0);
+
+        checkTableWithData(ignite, TABLE_NAME);
+    }
+
+    /**
+     * Starts two nodes and checks that the data are storing through restarts.
+     * Nodes restart in the same order when they started at first.
+     *
+     * @param testInfo Test information object.
+     */
+    @Test
+    public void testTwoNodesRestartDirect(TestInfo testInfo) {
+        twoNodesRestart(testInfo, true);
+    }
+
+    /**
+     * Starts two nodes and checks that the data are storing through restarts.
+     * Nodes restart in reverse order when they started at first.
+     *
+     * @param testInfo Test information object.
+     */
+    @Test
+    @Disabled("IGNITE-16034 Unblock a node start that happenes before 
Metastorage is ready")
+    public void testTwoNodesRestartReverse(TestInfo testInfo) {
+        twoNodesRestart(testInfo, false);
+    }
+
+    /**
+     * Starts two nodes and checks that the data are storing through restarts.
+     *
+     * @param testInfo Test information object.
+     * @param directOrder When the parameter is true, nodes restart in direct 
order, otherwise they restart in reverse order.
+     */
+    private void twoNodesRestart(TestInfo testInfo, boolean directOrder) {
+        Ignite ignite = startNode(testInfo, 0);
+
+        startNode(testInfo, 1);
+
+        createTableWithData(ignite, TABLE_NAME, 2);
+        createTableWithData(ignite, TABLE_NAME_2, 2);
+
+        stopNode(0);
+        stopNode(1);
+
+        if (directOrder) {
+            startNode(testInfo, 0);
+            ignite = startNode(testInfo, 1);
+        } else {
+            ignite = startNode(testInfo, 1);
+            startNode(testInfo, 0);
+        }
+
+        checkTableWithData(ignite, TABLE_NAME);
+        checkTableWithData(ignite, TABLE_NAME_2);
+    }
+
+    /**
+     * Find component of a given type in list.
+     *
+     * @param components Components list.
+     * @param cls Class.
+     * @param <T> Type parameter.
+     * @return Ignite component.
+     */
+    private <T extends IgniteComponent> T findComponent(List<IgniteComponent> 
components, Class<T> cls) {
+        for (IgniteComponent component : components) {
+            if (cls.isAssignableFrom(component.getClass())) {
+                return (T) component;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Checks that one node in a cluster of 2 nodes is able to restart and 
recover a table that was created when this node was absent.
+     * Also checks that the table created before node stop, is not available 
when majority if lost.
+     *
+     * @param testInfo Test info.
+     */
+    @Test
+    public void testOneNodeRestartWithGap(TestInfo testInfo) {

Review comment:
       Seems that given test should check 
   > that one node in a cluster of 2 nodes is able to restart and recover a 
table that was created when this node was absent
   
   however there are no such table creations during absence of the second node.




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