Skip to content

Commit 36731ef

Browse files
Merge pull request #14264 from Ayanda-D/await-condition-for-exceptions
Handle exceptions in rabbit_ct_helpers:await_condition_with_retries/2 to continue waiting
2 parents e35909a + faca67b commit 36731ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,16 @@ await_condition(ConditionFun, Timeout) ->
11301130
await_condition_with_retries(_ConditionFun, 0) ->
11311131
ct:fail("Condition did not materialize in the expected period of time");
11321132
await_condition_with_retries(ConditionFun, RetriesLeft) ->
1133-
case ConditionFun() of
1133+
try ConditionFun() of
11341134
false ->
11351135
timer:sleep(50),
11361136
await_condition_with_retries(ConditionFun, RetriesLeft - 1);
11371137
true ->
11381138
ok
1139+
catch
1140+
_:_ ->
1141+
timer:sleep(50),
1142+
await_condition_with_retries(ConditionFun, RetriesLeft - 1)
11391143
end.
11401144

11411145
%% Pass in any EUnit test object. Example:

0 commit comments

Comments
 (0)