Sega76 commented on a change in pull request #9444:
URL: https://github.com/apache/ignite/pull/9444#discussion_r731024417



##########
File path: 
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
##########
@@ -3024,6 +3026,90 @@ public void testClusterSnapshotCreate() throws Exception 
{
         assertTrue("Snapshot must contains cache data [left=" + range + ']', 
range.isEmpty());
     }
 
+    /** @throws Exception If failed. */
+    @Test
+    public void testClusterSnapshotStatus() throws Exception {
+        int keysCnt = 100;
+        String snpName = "snapshot_02052020";
+
+        IgniteEx ig = startGrid(0);
+        startGrid(1);
+
+        ig.cluster().state(ACTIVE);
+
+        int size = ig.cluster().nodes().size();
+
+        createCacheAndPreload(ig, keysCnt);
+
+        CommandHandler h = new CommandHandler();
+
+        assertEquals(EXIT_CODE_OK, execute(h, "--snapshot", "status"));
+
+        assertEquals(size, countMatches(h.getLastOperationResult().toString(), 
"No snapshot operation."));
+
+        TestRecordingCommunicationSpi spi0 = 
TestRecordingCommunicationSpi.spi(grid(0));
+        TestRecordingCommunicationSpi spi1 = 
TestRecordingCommunicationSpi.spi(grid(1));
+
+        spi0.blockMessages((node, msg) -> msg instanceof SingleNodeMessage &&
+            ((SingleNodeMessage<?>)msg).type() == END_SNAPSHOT.ordinal());
+
+        spi1.blockMessages((node, msg) -> msg instanceof SingleNodeMessage &&
+            ((SingleNodeMessage<?>)msg).type() == END_SNAPSHOT.ordinal());
+
+        assertEquals(EXIT_CODE_OK, execute(h, "--snapshot", "create", 
snpName));
+
+        assertTrue(waitForCondition(() -> {
+            assertEquals(EXIT_CODE_OK, execute(h, "--snapshot", "status"));
+
+            return size == countMatches(h.getLastOperationResult().toString(), 
"Creating the snapshot with name: " + snpName);
+        }, 10_000));

Review comment:
       fixed




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