You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import org.awaitility.Awaitility;
import java.time.Duration;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
new Test().test();
}
public void test() {
Scanner in = new Scanner(System.in);
Awaitility.await().pollDelay(Duration.ZERO).atMost(Duration.ofNanos(1)).until(in::hasNextLine);
if (in.hasNextLine()) {
String query = in.nextLine();
System.out.print("recieved: " + query);
}
}
}
Expected behavior: ConditionTimeoutException thrown "immediately"
Actual behavior: Code hangs until a value is entered via stdin.
Suspected issue:
It looks like there is a bug in org.awaitility.core.Uninterruptibles#shutdownUninterruptibly:
You can run this code to replicate the issue:
Expected behavior:
ConditionTimeoutException
thrown "immediately"Actual behavior: Code hangs until a value is entered via stdin.
Suspected issue:
It looks like there is a bug in
org.awaitility.core.Uninterruptibles#shutdownUninterruptibly
:awaitility/awaitility/src/main/java/org/awaitility/core/Uninterruptibles.java
Lines 122 to 146 in c4962d8
The method attempts to shutdown the executor running the
until
condition. In this case, it is being called here:awaitility/awaitility/src/main/java/org/awaitility/core/ExecutorLifecycle.java
Line 74 in c4962d8
Consequently it waits for 10^9 seconds instead of 1 second.
The fix is to edit the condition in line:
awaitility/awaitility/src/main/java/org/awaitility/core/Uninterruptibles.java
Line 131 in c4962d8
to be:
The text was updated successfully, but these errors were encountered: