amqp_client_SUITE: Close all connections in `end_per_testcase/2`

[Why]
Many tests do not clean up their connections if they encounter a
failure. This affects subsequent testcases negatively.
This commit is contained in:
Jean-Sébastien Pédron 2025-02-28 11:53:41 +01:00
parent ce5ba6da04
commit 4d12efae21
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
1 changed files with 5 additions and 1 deletions

View File

@ -359,7 +359,11 @@ end_per_testcase(Testcase, Config) ->
%% Assert that every testcase cleaned up.
rabbit_ct_broker_helpers:rpc(Config, 0, ?MODULE, delete_queues, []),
eventually(?_assertEqual([], rpc(Config, rabbit_amqqueue, list, []))),
%% Wait for sessions to terminate before starting the next test case.
%% Terminate all connections and wait for sessions to terminate before
%% starting the next test case.
_ = rabbit_ct_broker_helpers:rpc(
Config, 0,
rabbit_networking, close_all_connections, [<<"test finished">>]),
eventually(?_assertEqual([], rpc(Config, rabbit_amqp_session, list_local, []))),
%% Assert that global counters count correctly.
eventually(?_assertMatch(#{publishers := 0,