geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Helena Bales <hba...@pivotal.io>
Subject Awaitility may time out before evaluating the condition
Date Mon, 10 Sep 2018 23:06:17 GMT
Hello All,

Dale and I encountered an interesting Awaitility bug where an Awaitility
using "untilAsserted" timed out before it evaluated the condition. It
appears that Awaitility starts its timer before the thread has completely
started, and when the duration specified in "atMost" is reached, a
TimeoutException is thrown regardless of how much of the runnable/callable
has executed.

In the situation we encountered, an Awaitility had a duration of 1 second
and contained an assertion. The error that we saw was a TimeoutException
without a cause. When we had the same assertion before the failing
Awaitility, the assertion passed, then the awaitility failed. Increasing
the duration fixed this issue.

*tl;dr*
If you're getting TimeoutExceptions where you shouldn't be, check that your
"atMost" is long enough for the Awaitility thread to start AND your
conditions to be evaluated at least once.

-Helena and Dale

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message