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 2021/08/11 07:59:37 UTC

[GitHub] [ignite-3] ibessonov commented on a change in pull request #265: IGNITE-15275 Fix handshake operation

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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org