@@ -146,7 +146,7 @@ connection_metric_idemp(Config, {N, R}) ->
146146 Table2 = [ Pid || {Pid , _ } <- read_table_rpc (Config , connection_coarse_metrics )],
147147 % referesh stats 'R' times
148148 [[Pid ! emit_stats || Pid <- Table ] || _ <- lists :seq (1 , R )],
149- timer : sleep ( 100 ),
149+ force_metric_gc ( Config ),
150150 TableAfter = [ Pid || {Pid , _ } <- read_table_rpc (Config , connection_metrics )],
151151 TableAfter2 = [ Pid || {Pid , _ } <- read_table_rpc (Config , connection_coarse_metrics )],
152152 [rabbit_ct_client_helpers :close_connection (Conn ) || Conn <- Conns ],
@@ -160,7 +160,7 @@ channel_metric_idemp(Config, {N, R}) ->
160160 Table2 = [ Pid || {Pid , _ } <- read_table_rpc (Config , channel_process_metrics )],
161161 % referesh stats 'R' times
162162 [[Pid ! emit_stats || Pid <- Table ] || _ <- lists :seq (1 , R )],
163- timer : sleep ( 100 ),
163+ force_metric_gc ( Config ),
164164 TableAfter = [ Pid || {Pid , _ } <- read_table_rpc (Config , channel_metrics )],
165165 TableAfter2 = [ Pid || {Pid , _ } <- read_table_rpc (Config , channel_process_metrics )],
166166 rabbit_ct_client_helpers :close_connection (Conn ),
@@ -184,7 +184,7 @@ queue_metric_idemp(Config, {N, R}) ->
184184 % referesh stats 'R' times
185185 ChanTable = read_table_rpc (Config , channel_created ),
186186 [[Pid ! emit_stats || {Pid , _ , _ } <- ChanTable ] || _ <- lists :seq (1 , R )],
187- timer : sleep ( 100 ),
187+ force_metric_gc ( Config ),
188188 TableAfter = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_metrics )],
189189 TableAfter2 = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_coarse_metrics )],
190190 [ delete_queue (Chan , Q ) || Q <- Queues ],
@@ -398,7 +398,7 @@ read_table(Table) ->
398398 ets :tab2list (Table ).
399399
400400force_metric_gc (Config ) ->
401- timer :sleep (100 ),
401+ timer :sleep (300 ),
402402 rabbit_ct_broker_helpers :rpc (Config , 0 , erlang , send ,
403403 [rabbit_core_metrics_gc , start_gc ]),
404404 rabbit_ct_broker_helpers :rpc (Config , 0 , gen_server , call ,
0 commit comments