nizhikov commented on code in PR #11673: URL: https://github.com/apache/ignite/pull/11673#discussion_r1908315155
########## modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java: ########## @@ -752,6 +774,174 @@ public void testIdleVerifyOnInactiveClusterWithPersistence() throws Exception { assertContains(log, testOut.toString(), "The check procedure has finished, no conflicts have been found."); } + /** + * + */ + @Test + public void testIdleVerifyCancelCommandOnCheckpoint() throws Exception { + final int gridsCnt = 4; + + IgniteEx srv = startGrids(gridsCnt); + + srv.cluster().state(ACTIVE); + + CountDownLatch beforeCancelLatch = new CountDownLatch(1); + + CountDownLatch afterCancelLatch = new CountDownLatch(1); + + GridCacheDatabaseSharedManager dbMgr = + (GridCacheDatabaseSharedManager)grid(1).context().cache().context().database(); + + dbMgr.addCheckpointListener(new CheckpointListener() { + @Override public void beforeCheckpointBegin(Context ctx) { + if (ctx.progress().reason().equals("VerifyBackupPartitions")) + beforeCancelLatch.countDown(); + } + + @Override public void afterCheckpointEnd(Context ctx) throws IgniteCheckedException { + if (ctx.progress().reason().equals("VerifyBackupPartitions")) + try { + afterCancelLatch.await(); + } + catch (InterruptedException e) { + throw new IgniteInterruptedCheckedException(e); + } + } + + @Override public void onMarkCheckpointBegin(Context ctx) { + } + + @Override public void onCheckpointBegin(Context ctx) { + + } + }); + + List<LogListener> listeners = registerIdleVerifyCancelListeners(); + + IgniteCache<Integer, Integer> cache = srv.createCache(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME).setBackups(3)); + + for (int i = 0; i < 10000; i++) + cache.put(i, i); + + IgniteInternalFuture<Integer> idleVerifyFut = GridTestUtils.runAsync(() -> execute("--cache", "idle_verify")); + + beforeCancelLatch.await(); Review Comment: Let's wait some reasonable timeout here - like 10 sec or similar. -- 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-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org