diff --git a/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl b/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl index 003bc75ba38f..88d1f3ce8540 100644 --- a/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl +++ b/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl @@ -1130,16 +1130,12 @@ 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) -> - try ConditionFun() of + case 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: