diff --git a/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl b/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl index 88d1f3ce8540..003bc75ba38f 100644 --- a/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl +++ b/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl @@ -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: