Skip to content

Commit 3e28685

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) (cherry picked from commit b197867)
1 parent 6e8f51e commit 3e28685

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
@@ -1035,17 +1035,18 @@ logging_to_exchange_works(Config) ->
10351035
UpgradeFileHandler),
10361036

10371037
%% Wait for the expected exchange to be automatically declared.
1038-
lists:any(
1039-
fun(_) ->
1040-
Ret = rabbit_ct_broker_helpers:rpc(
1041-
Config, 0,
1042-
rabbit_exchange, lookup, [Exchange]),
1043-
case Ret of
1044-
{ok, _} -> true;
1045-
_ -> timer:sleep(500),
1046-
false
1047-
end
1048-
end, lists:seq(1, 20)),
1038+
?assert(
1039+
lists:any(
1040+
fun(_) ->
1041+
Ret = rabbit_ct_broker_helpers:rpc(
1042+
Config, 0,
1043+
rabbit_exchange, lookup, [Exchange]),
1044+
case Ret of
1045+
{ok, _} -> true;
1046+
_ -> timer:sleep(500),
1047+
false
1048+
end
1049+
end, lists:seq(1, 20))),
10491050

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

0 commit comments

Comments
 (0)