Skip to content

Commit 4d12efa

Browse files
committed
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.
1 parent ce5ba6d commit 4d12efa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deps/rabbit/test/amqp_client_SUITE.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,11 @@ end_per_testcase(Testcase, Config) ->
359359
%% Assert that every testcase cleaned up.
360360
rabbit_ct_broker_helpers:rpc(Config, 0, ?MODULE, delete_queues, []),
361361
eventually(?_assertEqual([], rpc(Config, rabbit_amqqueue, list, []))),
362-
%% Wait for sessions to terminate before starting the next test case.
362+
%% Terminate all connections and wait for sessions to terminate before
363+
%% starting the next test case.
364+
_ = rabbit_ct_broker_helpers:rpc(
365+
Config, 0,
366+
rabbit_networking, close_all_connections, [<<"test finished">>]),
363367
eventually(?_assertEqual([], rpc(Config, rabbit_amqp_session, list_local, []))),
364368
%% Assert that global counters count correctly.
365369
eventually(?_assertMatch(#{publishers := 0,

0 commit comments

Comments
 (0)