Skip to content

Commit 3ec1afd

Browse files
committed
Add note about Awaitility library to NB.4
1 parent 04da6af commit 3ec1afd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,10 @@ add a callback to the corresponding `CompletableFuture` or [`ListenableFuture`](
11121112
https://github.com/google/guava/wiki/ListenableFutureExplained) (check [TE.7](#cf-beware-non-async)
11131113
about doing this properly).
11141114

1115+
In test code waiting for some condition, a library such as [Awaitility](
1116+
https://github.com/awaitility/awaitility) could be used instead of explicit looping with
1117+
`Thread.sleep` calls.
1118+
11151119
Since `Thread.yield()` and `Thread.onSpinWait()` are rarely, if ever, useful outside of spin loops,
11161120
this item could also be interpreted as that there should be a comment to every call to either of
11171121
these methods, explaining either why they are called outside of a spin loop, or justifying the spin

0 commit comments

Comments
 (0)