EdColeman commented on code in PR #3508:
URL: https://github.com/apache/accumulo/pull/3508#discussion_r1239813136
##########
test/src/main/java/org/apache/accumulo/test/util/Wait.java:
##########
@@ -48,4 +50,13 @@ public static boolean waitFor(final Condition condition,
final long duration,
}
return conditionSatisfied;
}
+
+ /**
+ * A retry for use in junit tests when testing asynchronous conditions that
are expected to
+ * eventually meet the condition or fail the test. Using this method should
be used instead of an
+ * arbitrary sleep and hoping to catch the condition in the expected state.
+ */
+ public static void assertTrueWithRetry(final Wait.Condition condition)
throws Exception {
+ assertTrue(waitFor(condition));
+ }
Review Comment:
Originally @ctubbsii I thought the suggestion in PR #3384 to use a static
method in the test to replace the assertTrue(waitFor(....)
```
The method would look like:
private static void waitForTrue(Wait.Condition condition) throws Exception
{
// could specify 20 seconds, but the default is 30, and that's fine. The
default delay is 1.
assertTrue(Wait.waitFor(condition));
}
```
So that it could be consistent across tests, I though the Wait Util might me
a good home. I though the original `assertTrue(waitFor(x))` was clear enough,
but tried to be accommodating to your request. Maybe I didn't understand the
original request? At this point I do not know what you want.
It seems to be remove the method from Wait to eliminate the junit dependency
and just use `assertTrue(waifFor(` in the tests? as it was originally?
--
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]