Skip to content

Commit 314e426

Browse files
committed
minor: Avoid flake in rabbit_mgmt_http_health_checks_SUITE
The `below_node_connection_limit_test` and `ready_to_serve_clients_test` cases could possibly flake because `is_quorum_critical_single_node_test` uses the channel manager in `rabbit_ct_client_helpers` to open a connection. This can cause the line true = lists:all(fun(E) -> is_pid(E) end, Connections), to fail to match. The last connection could have been rejected if the channel manager kept its connection open, so instead of being a pid the element would have been `{error, not_allowed}`. With `rabbit_ct_client_helpers:close_channels_and_connection/2` we can reset the connection manager and force it to close its connection.
1 parent 3e1fa7b commit 314e426

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

deps/rabbitmq_management/test/rabbit_mgmt_http_health_checks_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ below_node_connection_limit_test(Config) ->
478478
?assertEqual(<<"ok">>, maps:get(status, Check0)),
479479

480480
%% Set the connection limit low and open 'limit' connections.
481+
rabbit_ct_client_helpers:close_channels_and_connection(Config, 0),
481482
Limit = 10,
482483
rabbit_ct_broker_helpers:rpc(
483484
Config, 0, application, set_env, [rabbit, connection_max, Limit]),
@@ -506,6 +507,7 @@ ready_to_serve_clients_test(Config) ->
506507
true = rabbit_ct_broker_helpers:unmark_as_being_drained(Config, 0),
507508

508509
%% Set the connection limit low and open 'limit' connections.
510+
rabbit_ct_client_helpers:close_channels_and_connection(Config, 0),
509511
Limit = 10,
510512
rabbit_ct_broker_helpers:rpc(
511513
Config, 0, application, set_env, [rabbit, connection_max, Limit]),

0 commit comments

Comments
 (0)