ibessonov commented on a change in pull request #265:
URL: https://github.com/apache/ignite-3/pull/265#discussion_r686586647



##########
File path: 
modules/core/src/test/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
##########
@@ -184,4 +185,26 @@ private static boolean hasCause(
 
         return false;
     }
+
+    /**
+     * Waits for the condition.
+     *
+     * @param cond Condition.
+     * @param timeoutMillis Timeout in milliseconds.
+     * @return {@code True} if the condition was satisfied within the timeout.
+     * @throws InterruptedException If waiting was interrupted.
+     */
+    @SuppressWarnings("BusyWait") public static boolean 
waitForCondition(BooleanSupplier cond, long timeoutMillis)
+        throws InterruptedException {
+        long stop = System.currentTimeMillis() + timeoutMillis;
+
+        while (System.currentTimeMillis() < stop) {
+            if (cond.getAsBoolean())
+                return true;
+
+            sleep(50);

Review comment:
       We can make it even lower




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