alievmirza commented on a change in pull request #426:
URL: https://github.com/apache/ignite-3/pull/426#discussion_r750964735



##########
File path: 
modules/raft/src/test/java/org/apache/ignite/raft/jraft/test/TestUtils.java
##########
@@ -183,4 +185,14 @@ public static boolean 
waitForArgumentCapture(ArgumentCaptor<?> captor, long time
             }
         }, timeout);
     }
+
+    /**
+     * Waits until all RAFT threads are stopped, throwing an 
AssertionException otherwise.
+     */
+    public static void assertAllThreadsStopped() {

Review comment:
       As for me, `assertAllJraftThreadsStopped` name is better 

##########
File path: 
modules/raft/src/test/java/org/apache/ignite/raft/jraft/test/TestUtils.java
##########
@@ -183,4 +185,14 @@ public static boolean 
waitForArgumentCapture(ArgumentCaptor<?> captor, long time
             }
         }, timeout);
     }
+
+    /**
+     * Waits until all RAFT threads are stopped, throwing an 
AssertionException otherwise.
+     */
+    public static void assertAllThreadsStopped() {
+        assertTrue(waitForCondition(() -> 
!Thread.getAllStackTraces().keySet().stream().

Review comment:
       Could be simplified 
   ```
           assertTrue(waitForCondition(() -> 
Thread.getAllStackTraces().keySet().stream().
                           noneMatch(t -> t.getName().contains("JRaft")), 
5_000),
               Thread.getAllStackTraces().keySet().stream().filter(t -> 
t.getName().contains("JRaft")).
                   
sorted(Comparator.comparing(Thread::getName)).collect(toList()).toString());
   ```

##########
File path: 
modules/raft/src/main/java/org/apache/ignite/raft/jraft/util/timer/DefaultTimer.java
##########
@@ -91,7 +91,7 @@ public boolean isCancelled() {
                 @Override
                 public boolean cancel() {
                     final ScheduledFuture<?> f = future;
-                    return f != null && f.cancel(true);
+                    return f != null && f.cancel(false); // Avoid interrupting 
thread in the pool.

Review comment:
       Why we need this change? 




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