@@ -187,6 +187,10 @@ queue_metric_idemp(Config, {N, R}) ->
187187 Queue
188188 end || _ <- lists :seq (1 , N )],
189189
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 ),
190194 Table = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_metrics )],
191195 Table2 = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_coarse_metrics )],
192196 % refresh stats 'R' times
@@ -196,12 +200,16 @@ queue_metric_idemp(Config, {N, R}) ->
196200 gen_server2 :call (Pid , flush )
197201 end || {Pid , _ , _ } <- ChanTable ] || _ <- lists :seq (1 , R )],
198202 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 ),
199207 TableAfter = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_metrics )],
200208 TableAfter2 = [ Pid || {Pid , _ , _ } <- read_table_rpc (Config , queue_coarse_metrics )],
201209 [ delete_queue (Chan , Q ) || Q <- Queues ],
202210 rabbit_ct_client_helpers :close_connection (Conn ),
203- (Table2 == TableAfter2 ) and ( Table == TableAfter ) and
204- ( N == length ( Table )) and (N == length (TableAfter )).
211+ (lists : sort ( Table2 ) == lists : sort ( TableAfter2 ))
212+ and (lists : sort ( Table ) == lists : sort (TableAfter )).
205213
206214connection_metric_count (Config , Ops ) ->
207215 add_rem_counter (Config , Ops ,
0 commit comments