Skip to content

Commit c9e9026

Browse files
committed
tests: clustering_SUITE wait for stats
1 parent 01ccda4 commit c9e9026

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

deps/rabbitmq_management/test/clustering_SUITE.erl

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,15 @@ queue_consumer_channel_closed(Config) ->
304304
amqp_channel:close(Chan),
305305
force_stats(Config),
306306

307-
Res = http_get(Config, "/queues/%2F/some-queue"),
308-
% assert there are no consumer details
309-
[] = maps:get(consumer_details, Res),
310-
<<"some-queue">> = maps:get(name, Res),
307+
?awaitMatch([],
308+
%% assert there are no consumer details
309+
maps:get(consumer_details,
310+
http_get(Config, "/queues/%2F/some-queue")),
311+
30000),
312+
?awaitMatch(<<"some-queue">>,
313+
maps:get(name,
314+
http_get(Config, "/queues/%2F/some-queue")),
315+
30000),
311316

312317
http_delete(Config, "/queues/%2F/some-queue", ?NO_CONTENT),
313318
ok.
@@ -325,10 +330,12 @@ queue(Config) ->
325330
basic_get(Chan2, <<"some-queue">>),
326331
force_stats(Config),
327332

328-
Res = http_get(Config, "/queues/%2F/some-queue"),
329333
% assert single queue is returned
330-
[#{} | _] = maps:get(deliveries, Res),
331-
334+
?awaitMatch([#{} | _],
335+
maps:get(deliveries,
336+
http_get(Config, "/queues/%2F/some-queue")),
337+
30000),
338+
332339
amqp_channel:close(Chan),
333340
amqp_channel:close(Chan2),
334341
http_delete(Config, "/queues/%2F/some-queue", ?NO_CONTENT),
@@ -390,9 +397,10 @@ channels_multiple_on_different_nodes(Config) ->
390397

391398
force_stats(Config),
392399

393-
Res = http_get(Config, "/channels"),
394400
% assert two channels are present
395-
[_,_] = Res,
401+
?awaitMatch([_,_],
402+
http_get(Config, "/channels"),
403+
30000),
396404

397405
http_delete(Config, "/queues/%2F/some-queue", ?NO_CONTENT),
398406

0 commit comments

Comments
 (0)