handle exceptions in rabbit_ct_helpers:await_condition_with_retries/2 and continue waiting
(cherry picked from commit faca67b5e6
)
This commit is contained in:
parent
c6e7eec7cf
commit
81b6c4de9b
|
@ -1130,12 +1130,16 @@ await_condition(ConditionFun, Timeout) ->
|
|||
await_condition_with_retries(_ConditionFun, 0) ->
|
||||
ct:fail("Condition did not materialize in the expected period of time");
|
||||
await_condition_with_retries(ConditionFun, RetriesLeft) ->
|
||||
case ConditionFun() of
|
||||
try ConditionFun() of
|
||||
false ->
|
||||
timer:sleep(50),
|
||||
await_condition_with_retries(ConditionFun, RetriesLeft - 1);
|
||||
true ->
|
||||
ok
|
||||
catch
|
||||
_:_ ->
|
||||
timer:sleep(50),
|
||||
await_condition_with_retries(ConditionFun, RetriesLeft - 1)
|
||||
end.
|
||||
|
||||
%% Pass in any EUnit test object. Example:
|
||||
|
|
Loading…
Reference in New Issue