nizhikov commented on a change in pull request #9409:
URL: https://github.com/apache/ignite/pull/9409#discussion_r710850053



##########
File path: 
modules/control-utility/src/test/java/org/apache/ignite/util/KillCommandsCommandShTest.java
##########
@@ -195,4 +205,97 @@ public void testCancelUnknownContinuousQuery() {
 
         assertEquals(EXIT_CODE_OK, res);
     }
+
+    /** */
+    @Test
+    public void testCancelConsistencyMissedTask() {
+        int res = execute("--kill", "consistency");
+
+        assertEquals(EXIT_CODE_OK, res);
+    }
+
+    /** */
+    @Test
+    public void testCancelConsistencyTask() throws InterruptedException {
+        String consistencyCancheName = "consistencyCache";
+
+        CacheConfiguration<Integer, Integer> cfg = new CacheConfiguration<>();
+
+        cfg.setName(consistencyCancheName);
+        cfg.setBackups(SERVER_NODE_CNT - 1);
+
+        IgniteCache<Integer, Integer> cache = client.getOrCreateCache(cfg);
+
+        for (int i = 0; i < 10_000; i++)
+            cache.put(i, i);
+
+        CountDownLatch getLatch = new CountDownLatch(SERVER_NODE_CNT); // Each 
node should send a get request.
+
+        for (IgniteEx server : srvs) {
+            TestRecordingCommunicationSpi spi =
+                
((TestRecordingCommunicationSpi)server.configuration().getCommunicationSpi());
+
+            spi.blockMessages((node, message) -> {
+                if (message instanceof GridNearGetRequest) { // Get request 
caused by read repair operation.
+                    getLatch.countDown();
+
+                    return true; // Blocking to freeze '--consistency repair' 
operation.
+                }
+
+                return false;
+            });
+        }
+
+        CountDownLatch thLatch = new CountDownLatch(1);
+
+        new Thread(() -> {
+            try {
+                getLatch.await(); // Waiting for consistency repair start.
+            }
+            catch (InterruptedException e) {
+                fail();
+            }
+
+            IgnitePredicate<GridJobWorker> repairJobFilter =

Review comment:
       Can we use existing system view instead of creating new method?
   `SELECT * FROM SYS.JOB WHERE CLASS_NAME = ?`




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