Skip to content

Commit dae661b

Browse files
Update tests for an intentional behavior change in #16610 #16598
`amqp_channels_manager:handle_open_channel/4` now can get an error tuple back where previously connections would fail due to a badmatch, producing crash logs. Note that the broker only actively closes TCP-based connections on these errors (via `rabbit_reader:handle_exception/3`). The direct AMQP 0-9-1 client previously got an identical outcome via the badmatch crash; updating it to properly close is out of scope for this commit and will be investigated next.
1 parent 8a555b8 commit dae661b

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

deps/rabbit/test/per_user_connection_channel_limit_SUITE.erl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,8 @@ cluster_single_user_limit(Config) ->
11411141
expect_that_client_connection_is_rejected(Config, 0, Username),
11421142
expect_that_client_connection_is_rejected(Config, 1, Username),
11431143
expect_that_client_channel_is_rejected(Conn1),
1144+
%% On direct connections, channel rejection does not close the connection.
1145+
close_connections([Conn1]),
11441146
rabbit_ct_helpers:await_condition(
11451147
fun () ->
11461148
is_process_alive(Conn1) =:= false andalso
@@ -1175,6 +1177,8 @@ cluster_single_user_limit2(Config) ->
11751177
expect_that_client_connection_is_rejected(Config, 0, Username),
11761178
expect_that_client_connection_is_rejected(Config, 1, Username),
11771179
expect_that_client_channel_is_rejected(Conn1),
1180+
%% On direct connections, channel rejection does not close the connection.
1181+
close_connections([Conn1]),
11781182
rabbit_ct_helpers:await_condition(
11791183
fun () ->
11801184
is_process_alive(Conn1) =:= false andalso
@@ -1225,6 +1229,8 @@ cluster_single_user_zero_limit(Config) ->
12251229
count_connections_of_user(Config, Username) =:= 1
12261230
end),
12271231
expect_that_client_channel_is_rejected(ConnA),
1232+
%% On direct connections, channel rejection does not close the connection.
1233+
close_connections([ConnA]),
12281234
rabbit_ct_helpers:await_condition(
12291235
fun () ->
12301236
count_connections_of_user(Config, Username) =:= 0 andalso
@@ -1268,6 +1274,8 @@ cluster_single_user_clear_limits(Config) ->
12681274
expect_that_client_connection_is_rejected(Config, 0, Username),
12691275
expect_that_client_connection_is_rejected(Config, 1, Username),
12701276
expect_that_client_channel_is_rejected(Conn1),
1277+
%% On direct connections, channel rejection does not close the connection.
1278+
close_connections([Conn1]),
12711279
rabbit_ct_helpers:await_condition(
12721280
fun () ->
12731281
is_process_alive(Conn1) =:= false andalso
@@ -1336,6 +1344,8 @@ cluster_multiple_users_clear_limits(Config) ->
13361344
count_connections_of_user(Config, Username2) =:= 1
13371345
end),
13381346
expect_that_client_channel_is_rejected(ConnA),
1347+
%% On direct connections, channel rejection does not close the connection.
1348+
close_connections([ConnA]),
13391349

13401350
rabbit_ct_helpers:await_condition(
13411351
fun () ->
@@ -1420,6 +1430,8 @@ cluster_multiple_users_zero_limit(Config) ->
14201430
[ConnA, ConnB] = open_connections(Config, [{0, Username1}, {1, Username2}]),
14211431

14221432
expect_that_client_channel_is_rejected(ConnA),
1433+
%% On direct connections, channel rejection does not close the connection.
1434+
close_connections([ConnA]),
14231435
rabbit_ct_helpers:await_condition(
14241436
fun () ->
14251437
count_connections_of_user(Config, Username1) =:= 0 andalso

deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ is_mixed_versions(Config) ->
10521052
%% -------------------------------------------------------------------
10531053

10541054
await_condition(ConditionFun) ->
1055-
await_condition(ConditionFun, 10_000).
1055+
await_condition(ConditionFun, 15_000).
10561056

10571057
await_condition(ConditionFun, Timeout) ->
10581058
Retries = ceil(Timeout / 50),

0 commit comments

Comments
 (0)