Skip to content

Commit

Permalink
Merge pull request #7476 from rabbitmq/remove-dead-code-in-per_user_c…
Browse files Browse the repository at this point in the history
…onnection_channel_tracking_SUITE

per_user_connection_channel_tracking_SUITE: Remove dead code
  • Loading branch information
dumbbell authored Mar 1, 2023
2 parents dfc2ee6 + 0fad97f commit 3b6b8ef
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ cluster_node_removed(Config) ->

rabbit_ct_broker_helpers:forget_cluster_node(Config, 0, 1),
timer:sleep(200),
NodeName = rabbit_ct_broker_helpers:get_node_config(Config, 1, nodename),

?assertEqual(false, is_process_alive(Conn2)),
[?assertEqual(false, is_process_alive(Ch)) || Ch <- Chans2],
Expand Down Expand Up @@ -720,30 +719,24 @@ exists_in_tracked_connection_per_vhost_table(Config, VHost) ->
exists_in_tracked_connection_per_vhost_table(Config, 0, VHost).
exists_in_tracked_connection_per_vhost_table(Config, NodeIndex, VHost) ->
exists_in_tracking_table(Config, NodeIndex,
fun rabbit_connection_tracking:tracked_connection_per_vhost_table_name_for/1,
tracked_connection_per_vhost,
VHost).

exists_in_tracked_connection_per_user_table(Config, Username) ->
exists_in_tracked_connection_per_user_table(Config, 0, Username).
exists_in_tracked_connection_per_user_table(Config, NodeIndex, Username) ->
exists_in_tracking_table(Config, NodeIndex,
fun rabbit_connection_tracking:tracked_connection_per_user_table_name_for/1,
tracked_connection_per_user,
Username).

exists_in_tracked_channel_per_user_table(Config, Username) ->
exists_in_tracked_channel_per_user_table(Config, 0, Username).
exists_in_tracked_channel_per_user_table(Config, NodeIndex, Username) ->
exists_in_tracking_table(Config, NodeIndex,
fun rabbit_channel_tracking:tracked_channel_per_user_table_name_for/1,
tracked_channel_per_user,
Username).

exists_in_tracking_table(Config, NodeIndex, TableNameFun, Table, Key) ->
Node = rabbit_ct_broker_helpers:get_node_config(
Config, NodeIndex, nodename),
Tab = TableNameFun(Node),
exists_in_tracking_table(Config, NodeIndex, Table, Key) ->
All = rabbit_ct_broker_helpers:rpc(Config, NodeIndex,
ets, lookup, [Table, Key]),
lists:keymember(Key, 1, All).
Expand Down

0 comments on commit 3b6b8ef

Please sign in to comment.