Skip to content

Commit b197867

Browse files
dumbbellmergify[bot]
authored andcommitted
logging_SUITE: Ensure the exchange was declared in logging_to_exchange_works
[Why] We were running the check to make sure the exchange was declared, but we didn't verify the result of that check. The testcase would still fail later but if we verify its existence early, the testcase can fail early too. (cherry picked from commit 3cc3a38)
1 parent 608f78d commit b197867

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

deps/rabbit/test/logging_SUITE.erl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -922,17 +922,18 @@ logging_to_exchange_works(Config) ->
922922
#{exchange := #resource{name = XName} = Exchange}} = ExchangeHandler,
923923

924924
%% Wait for the expected exchange to be automatically declared.
925-
lists:any(
926-
fun(_) ->
927-
Ret = rabbit_ct_broker_helpers:rpc(
928-
Config, 0,
929-
rabbit_exchange, lookup, [Exchange]),
930-
case Ret of
931-
{ok, _} -> true;
932-
_ -> timer:sleep(500),
933-
false
934-
end
935-
end, lists:seq(1, 20)),
925+
?assert(
926+
lists:any(
927+
fun(_) ->
928+
Ret = rabbit_ct_broker_helpers:rpc(
929+
Config, 0,
930+
rabbit_exchange, lookup, [Exchange]),
931+
case Ret of
932+
{ok, _} -> true;
933+
_ -> timer:sleep(500),
934+
false
935+
end
936+
end, lists:seq(1, 20))),
936937

937938
%% Declare a queue to collect all logged messages.
938939
{Conn, Chan} = rabbit_ct_client_helpers:open_connection_and_channel(

0 commit comments

Comments
 (0)