xyuanlu commented on code in PR #2458:
URL: https://github.com/apache/helix/pull/2458#discussion_r1178686051
##########
helix-core/src/test/java/org/apache/helix/TestHelper.java:
##########
@@ -803,19 +803,9 @@ public interface Verifier {
}
public static boolean verify(Verifier verifier, long timeout) throws
Exception {
- long start = System.currentTimeMillis();
- do {
- boolean result = verifier.verify();
- boolean isTimedout = (System.currentTimeMillis() - start) > timeout;
- if (result || isTimedout) {
- if (isTimedout && !result) {
- LOG.error("verifier time out, consider try longer timeout, stack
trace{}",
- Arrays.asList(Thread.currentThread().getStackTrace()));
- }
- return result;
- }
- Thread.sleep(50);
- } while (true);
+ with().pollInterval(50, TimeUnit.MILLISECONDS).atMost(timeout,
TimeUnit.MILLISECONDS).await()
Review Comment:
Please correct me if I am wrong. I think Verifier provided same
functionality as await?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]