You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nk1506 (via GitHub)" <gi...@apache.org> on 2023/10/04 17:07:18 UTC
Re: [PR] Thread.sleep() method is replaced with Awaitility [iceberg]
nk1506 commented on code in PR #8715:
URL: https://github.com/apache/iceberg/pull/8715#discussion_r1346198636
##########
api/src/test/java/org/apache/iceberg/metrics/TestDefaultTimer.java:
##########
@@ -104,7 +106,7 @@ public void measureRunnable() {
Runnable runnable =
() -> {
try {
- Thread.sleep(100);
+ Awaitility.await().atLeast(Duration.ofMillis(100)).until(() -> true);
Review Comment:
won't it become flaky, if callable condition is evaluated sooner.
`if (evaluationDuration.compareTo(minWaitTime) < 0) {
String message = String.format("Condition was evaluated in %s which is earlier than expected minimum timeout %s",
formatAsString(evaluationDuration), formatAsString(minWaitTime));
conditionEvaluationHandler.handleTimeout(message, true);
throw new ConditionTimeoutException(message);
}`
Why not use something like `https://github.com/apache/iceberg/blob/master/api/src/test/java/org/apache/iceberg/TestHelpers.java#L57`
?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org