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/12/21 09:20:11 UTC

[GitHub] [ignite] Vladsz83 commented on a diff in pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Vladsz83 commented on code in PR #10454:
URL: https://github.com/apache/ignite/pull/10454#discussion_r1054157679


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -1224,6 +1224,31 @@ public void testClusterSnapshotFinishedTryCancel() throws Exception {
         assertSnapshotCacheKeys(snpIg.cache(dfltCacheCfg.getName()));
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testClientHandlesSnapshotFailOnStartStage() throws Exception {
+        Ignite ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE);
+
+        Ignite cln = startClientGrid();
+
+        TestRecordingCommunicationSpi failNodeSpi = TestRecordingCommunicationSpi.spi(grid(1));
+
+        failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage);
+
+        IgniteFuture<Void> fut = ignite.snapshot().createSnapshot(SNAPSHOT_NAME);
+
+        failNodeSpi.waitForBlocked(1, 10_000L);
+
+        grid(1).close();
+
+        assertThrowsAnyCause(log,
+            fut::get,
+            ClusterTopologyException.class,
+            "Snapshot operation interrupted, because baseline node left the cluster");
+
+        assertTrue(G.allGrids().contains(cln));

Review Comment:
   Test look flacky. Think we should wait for the client gone catching NODE_LEFT/NODE_FAILED event.



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