Skip to content

Commit 916ccca

Browse files
committed
per_user_connection_channel_limit_SUITE: Fix test flake in single_node_list_in_user
[Why] This was the only place where a condition was checked once after a connection close, instead of waiting for it to become true. This caused some transient failures in CI when the connection tracking took a bit of time to update and the check was performed before that.
1 parent 20da68b commit 916ccca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

deps/rabbit/test/per_user_connection_channel_limit_SUITE.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,13 @@ single_node_list_in_user(Config) ->
374374
[Conn4] = open_connections(Config, [{0, Username1}]),
375375
[_Chan4] = open_channels(Conn4, 1),
376376
close_connections([Conn4]),
377-
[#tracked_connection{username = Username1}] = connections_in(Config, Username1),
377+
rabbit_ct_helpers:await_condition(
378+
fun () ->
379+
case connections_in(Config, Username1) of
380+
[#tracked_connection{username = Username1}] -> true;
381+
_ -> false
382+
end
383+
end),
378384
[#tracked_channel{username = Username1}] = channels_in(Config, Username1),
379385

380386
[Conn5, Conn6] = open_connections(Config, [{0, Username2}, {0, Username2}]),

0 commit comments

Comments
 (0)