@@ -46,7 +46,8 @@ merge_app_env(Config) ->
46
46
rabbit_ct_helpers :merge_app_env (Config ,
47
47
{rabbit , [
48
48
{collect_statistics , fine },
49
- {collect_statistics_interval , 500 }
49
+ {collect_statistics_interval , 500 },
50
+ {core_metrics_gc_interval , 5000 }
50
51
]}).
51
52
init_per_suite (Config ) ->
52
53
rabbit_ct_helpers :log_environment (),
@@ -186,6 +187,10 @@ queue_metric_idemp(Config, {N, R}) ->
186
187
Queue
187
188
end || _ <- lists :seq (1 , N )],
188
189
190
+ ? awaitMatch (N , length (read_table_rpc (Config , queue_metrics )),
191
+ 30000 ),
192
+ ? awaitMatch (N , length (read_table_rpc (Config , queue_coarse_metrics )),
193
+ 30000 ),
189
194
Table = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_metrics )],
190
195
Table2 = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_coarse_metrics )],
191
196
% refresh stats 'R' times
@@ -195,12 +200,16 @@ queue_metric_idemp(Config, {N, R}) ->
195
200
gen_server2 :call (Pid , flush )
196
201
end || {Pid , _ , _ } <- ChanTable ] || _ <- lists :seq (1 , R )],
197
202
force_metric_gc (Config ),
203
+ ? awaitMatch (N , length (read_table_rpc (Config , queue_metrics )),
204
+ 30000 ),
205
+ ? awaitMatch (N , length (read_table_rpc (Config , queue_coarse_metrics )),
206
+ 30000 ),
198
207
TableAfter = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_metrics )],
199
208
TableAfter2 = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_coarse_metrics )],
200
209
[ delete_queue (Chan , Q ) || Q <- Queues ],
201
210
rabbit_ct_client_helpers :close_connection (Conn ),
202
- (Table2 == TableAfter2 ) and ( Table == TableAfter ) and
203
- ( N == length ( Table )) and (N == length (TableAfter )).
211
+ (lists : sort ( Table2 ) == lists : sort ( TableAfter2 ))
212
+ and (lists : sort ( Table ) == lists : sort (TableAfter )).
204
213
205
214
connection_metric_count (Config , Ops ) ->
206
215
add_rem_counter (Config , Ops ,
@@ -295,9 +304,12 @@ connection(Config) ->
295
304
[_ ] = read_table_rpc (Config , connection_coarse_metrics ),
296
305
ok = rabbit_ct_client_helpers :close_connection (Conn ),
297
306
force_metric_gc (Config ),
298
- [] = read_table_rpc (Config , connection_created ),
299
- [] = read_table_rpc (Config , connection_metrics ),
300
- [] = read_table_rpc (Config , connection_coarse_metrics ),
307
+ ? awaitMatch ([], read_table_rpc (Config , connection_created ),
308
+ 30000 ),
309
+ ? awaitMatch ([], read_table_rpc (Config , connection_metrics ),
310
+ 30000 ),
311
+ ? awaitMatch ([], read_table_rpc (Config , connection_coarse_metrics ),
312
+ 30000 ),
301
313
ok .
302
314
303
315
channel (Config ) ->
0 commit comments