@@ -544,13 +544,21 @@ vhosts_test(Config) ->
544544 rabbit_ct_broker_helpers :force_vhost_failure (Config , <<" myvhost" >>),
545545 [NodeData ] = http_get (Config , " /nodes" ),
546546 Node = binary_to_atom (maps :get (name , NodeData ), utf8 ),
547- assert_item (#{name => <<" myvhost" >>, cluster_state => #{Node => <<" stopped" >>}},
548- http_get (Config , " /vhosts/myvhost" )),
547+ ? AWAIT (begin
548+ assert_item (#{name => <<" myvhost" >>,
549+ cluster_state => #{Node => <<" stopped" >>}},
550+ http_get (Config , " /vhosts/myvhost" )),
551+ true
552+ end ),
549553
550554 % % Restart it
551555 http_post (Config , " /vhosts/myvhost/start/" ++ atom_to_list (Node ), [], {group , '2xx' }),
552- assert_item (#{name => <<" myvhost" >>, cluster_state => #{Node => <<" running" >>}},
553- http_get (Config , " /vhosts/myvhost" )),
556+ ? AWAIT (begin
557+ assert_item (#{name => <<" myvhost" >>,
558+ cluster_state => #{Node => <<" running" >>}},
559+ http_get (Config , " /vhosts/myvhost" )),
560+ true
561+ end ),
554562
555563 % % Restart on a non-existent node
556564 http_post (Config , " /vhosts/myvhost/start/does-not-exist" , [], ? BAD_REQUEST ),
@@ -1408,35 +1416,36 @@ queues_test(Config) ->
14081416 % % The vhost is down
14091417 Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
14101418 DownVHost = #{name => <<" downvhost" >>, tracing => false , cluster_state => #{Node => <<" stopped" >>}},
1411- assert_item (DownVHost , http_get (Config , " /vhosts/downvhost" )),
1412-
1413- DownQueues = http_get (Config , " /queues/downvhost" ),
1414- DownQueue = http_get (Config , " /queues/downvhost/foo" ),
1415-
1416- assert_list ([#{name => <<" bar" >>,
1417- vhost => <<" downvhost" >>,
1418- state => <<" stopped" >>,
1419- durable => true ,
1420- auto_delete => false ,
1421- exclusive => false ,
1422- arguments => #{'x-queue-type' => <<" classic" >>}
1423- },
1424- #{name => <<" foo" >>,
1425- vhost => <<" downvhost" >>,
1426- state => <<" stopped" >>,
1427- durable => true ,
1428- auto_delete => false ,
1429- exclusive => false ,
1430- arguments => #{'x-queue-type' => <<" classic" >>}
1431- }], DownQueues ),
1432- assert_item (#{name => <<" foo" >>,
1433- vhost => <<" downvhost" >>,
1434- state => <<" stopped" >>,
1435- durable => true ,
1436- auto_delete => false ,
1437- exclusive => false ,
1438- arguments => #{'x-queue-type' => <<" classic" >>}
1439- }, DownQueue ),
1419+ DownQueueExpected = [#{name => <<" bar" >>,
1420+ vhost => <<" downvhost" >>,
1421+ state => <<" stopped" >>,
1422+ durable => true ,
1423+ auto_delete => false ,
1424+ exclusive => false ,
1425+ arguments => #{'x-queue-type' => <<" classic" >>}
1426+ },
1427+ #{name => <<" foo" >>,
1428+ vhost => <<" downvhost" >>,
1429+ state => <<" stopped" >>,
1430+ durable => true ,
1431+ auto_delete => false ,
1432+ exclusive => false ,
1433+ arguments => #{'x-queue-type' => <<" classic" >>}
1434+ }],
1435+ ? AWAIT (begin
1436+ assert_item (DownVHost , http_get (Config , " /vhosts/downvhost" )),
1437+ assert_list (DownQueueExpected , http_get (Config , " /queues/downvhost" )),
1438+ assert_item (#{name => <<" foo" >>,
1439+ vhost => <<" downvhost" >>,
1440+ state => <<" stopped" >>,
1441+ durable => true ,
1442+ auto_delete => false ,
1443+ exclusive => false ,
1444+ arguments => #{'x-queue-type' => <<" classic" >>}
1445+ },
1446+ http_get (Config , " /queues/downvhost/foo" )),
1447+ true
1448+ end ),
14401449
14411450 http_put (Config , " /queues/badvhost/bar" , Good , ? NOT_FOUND ),
14421451 http_put (Config , " /queues/%2F/bar" ,
0 commit comments