Skip to content

Commit

Permalink
Test: metrics_SUITE queue_idemp wait for queue metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dcorbacho committed Oct 31, 2024
1 parent e1c22a0 commit 0df71d5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions deps/rabbit/test/metrics_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ queue_metric_idemp(Config, {N, R}) ->
Queue
end || _ <- lists:seq(1, N)],

?awaitMatch(N, length(read_table_rpc(Config, queue_metrics)),
30000),
?awaitMatch(N, length(read_table_rpc(Config, queue_coarse_metrics)),
30000),
Table = [ Pid || {Pid, _, _} <- read_table_rpc(Config, queue_metrics)],
Table2 = [ Pid || {Pid, _, _} <- read_table_rpc(Config, queue_coarse_metrics)],
% refresh stats 'R' times
Expand All @@ -196,12 +200,16 @@ queue_metric_idemp(Config, {N, R}) ->
gen_server2:call(Pid, flush)
end|| {Pid, _, _} <- ChanTable ] || _ <- lists:seq(1, R)],
force_metric_gc(Config),
?awaitMatch(N, length(read_table_rpc(Config, queue_metrics)),
30000),
?awaitMatch(N, length(read_table_rpc(Config, queue_coarse_metrics)),
30000),
TableAfter = [ Pid || {Pid, _, _} <- read_table_rpc(Config, queue_metrics)],
TableAfter2 = [ Pid || {Pid, _, _} <- read_table_rpc(Config, queue_coarse_metrics)],
[ delete_queue(Chan, Q) || Q <- Queues],
rabbit_ct_client_helpers:close_connection(Conn),
(Table2 == TableAfter2) and (Table == TableAfter) and
(N == length(Table)) and (N == length(TableAfter)).
(lists:sort(Table2) == lists:sort(TableAfter2))
and (lists:sort(Table) == lists:sort(TableAfter)).

connection_metric_count(Config, Ops) ->
add_rem_counter(Config, Ops,
Expand Down

0 comments on commit 0df71d5

Please sign in to comment.