You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by do...@apache.org on 2026/10/01 20:58:28 UTC

(accumulo) branch 2.1 updated: Add Wait.waitFor() overload for just error msg (#6572)

This is an automated email from the ASF dual-hosted git repository.

DomGarguilo pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 8850fd1cce Add Wait.waitFor() overload for just error msg (#6572)
8850fd1cce is described below

commit 8850fd1cce00daa026b852769ec0a39d2b461b68
Author: Dom G. <do...@apache.org>
AuthorDate: Thu Oct 1 16:58:22 2026 -0400

    Add Wait.waitFor() overload for just error msg (#6572)
---
 .../java/org/apache/accumulo/test/util/Wait.java   | 31 ++++++++++++++++------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/test/src/main/java/org/apache/accumulo/test/util/Wait.java b/test/src/main/java/org/apache/accumulo/test/util/Wait.java
index d73bd52866..f72d5532a7 100644
--- a/test/src/main/java/org/apache/accumulo/test/util/Wait.java
+++ b/test/src/main/java/org/apache/accumulo/test/util/Wait.java
@@ -56,8 +56,9 @@ public class Wait {
   }
 
   /**
-   * Wait for the provided condition - will throw an IllegalStateException is the wait exceeds the
-   * default wait period of 30 seconds and a retry period of 1 second.
+   * Wait for the provided condition - will throw an IllegalStateException if the wait exceeds the
+   * default wait period of {@link #MAX_WAIT_MILLIS} with a retry period of {@link #SLEEP_MILLIS}.
+   * Both are scaled by the timeout factor.
    *
    * @param condition when condition evaluates true, return from wait
    */
@@ -66,8 +67,22 @@ public class Wait {
   }
 
   /**
-   * Wait for the provided condition - will throw an IllegalStateException is the wait exceeds the
-   * wait duration with a default retry period of 1 second.
+   * Wait for the provided condition - will throw an IllegalStateException if the wait exceeds the
+   * default wait period of {@link #MAX_WAIT_MILLIS} with a retry period of {@link #SLEEP_MILLIS}.
+   * Both are scaled by the timeout factor.
+   *
+   * @param condition when condition evaluates true, return from wait
+   * @param failMessage optional message to include in IllegalStateException if condition not met
+   *        before expiration.
+   */
+  public static void waitFor(final Condition condition, final String failMessage) {
+    waitFor(condition, MAX_WAIT_MILLIS, SLEEP_MILLIS, failMessage);
+  }
+
+  /**
+   * Wait for the provided condition - will throw an IllegalStateException if the wait exceeds the
+   * given wait duration with a default retry period of {@link #SLEEP_MILLIS}. Both are scaled by
+   * the timeout factor.
    *
    * @param condition when condition evaluates true, return from wait
    * @param duration maximum total time to wait (milliseconds)
@@ -77,8 +92,8 @@ public class Wait {
   }
 
   /**
-   * Wait for the provided condition - will throw an IllegalStateException is the wait exceeds the
-   * wait period.
+   * Wait for the provided condition - will throw an IllegalStateException if the wait exceeds the
+   * given wait duration.
    *
    * @param condition when condition evaluates true, return from wait
    * @param duration maximum total time to wait (milliseconds)
@@ -90,8 +105,8 @@ public class Wait {
   }
 
   /**
-   * Wait for the provided condition - will throw an IllegalStateException is the wait exceeds the
-   * wait period.
+   * Wait for the provided condition - will throw an IllegalStateException if the wait exceeds the
+   * given wait duration.
    *
    * @param condition when condition evaluates true, return from wait
    * @param duration maximum total time to wait (milliseconds)