-
-
Notifications
You must be signed in to change notification settings - Fork 249
Open
Description
Is there any ability to finish successfully, even if time is out?
Problem:
We are using await().until()
in our UI tests to verify asynchronous conditions. These tests run in a single thread. Frequently, the condition being evaluated returns true just as the timeout is reached. However, instead of completing successfully, await().until() throws a timeout exception.
This behavior is inconvenient because we still want to check if the last retry was successful. And if it was (even if the time is over) we still want to continue a successful execution.
await()
.pollInSameThread()
.atMost(60, TimeUnit.SECONDS)
.until(() -> {
// ... some check that may take several seconds
// ... condition evaluation logic
return conditionMet; // Returns true at the 60-second mark
});
Metadata
Metadata
Assignees
Labels
No labels