@@ -553,13 +553,21 @@ vhosts_test(Config) ->
553553 rabbit_ct_broker_helpers :force_vhost_failure (Config , <<" myvhost" >>),
554554 [NodeData ] = http_get (Config , " /nodes" ),
555555 Node = binary_to_atom (maps :get (name , NodeData ), utf8 ),
556- assert_item (#{name => <<" myvhost" >>, cluster_state => #{Node => <<" stopped" >>}},
557- http_get (Config , " /vhosts/myvhost" )),
556+ ? AWAIT (begin
557+ assert_item (#{name => <<" myvhost" >>,
558+ cluster_state => #{Node => <<" stopped" >>}},
559+ http_get (Config , " /vhosts/myvhost" )),
560+ true
561+ end ),
558562
559563 % % Restart it
560564 http_post (Config , " /vhosts/myvhost/start/" ++ atom_to_list (Node ), [], {group , '2xx' }),
561- assert_item (#{name => <<" myvhost" >>, cluster_state => #{Node => <<" running" >>}},
562- http_get (Config , " /vhosts/myvhost" )),
565+ ? AWAIT (begin
566+ assert_item (#{name => <<" myvhost" >>,
567+ cluster_state => #{Node => <<" running" >>}},
568+ http_get (Config , " /vhosts/myvhost" )),
569+ true
570+ end ),
563571
564572 % % Restart on a non-existent node
565573 http_post (Config , " /vhosts/myvhost/start/does-not-exist" , [], ? BAD_REQUEST ),
@@ -1417,35 +1425,36 @@ queues_test(Config) ->
14171425 % % The vhost is down
14181426 Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
14191427 DownVHost = #{name => <<" downvhost" >>, tracing => false , cluster_state => #{Node => <<" stopped" >>}},
1420- assert_item (DownVHost , http_get (Config , " /vhosts/downvhost" )),
1421-
1422- DownQueues = http_get (Config , " /queues/downvhost" ),
1423- DownQueue = http_get (Config , " /queues/downvhost/foo" ),
1424-
1425- assert_list ([#{name => <<" bar" >>,
1426- vhost => <<" downvhost" >>,
1427- state => <<" stopped" >>,
1428- durable => true ,
1429- auto_delete => false ,
1430- exclusive => false ,
1431- arguments => #{'x-queue-type' => <<" classic" >>}
1432- },
1433- #{name => <<" foo" >>,
1434- vhost => <<" downvhost" >>,
1435- state => <<" stopped" >>,
1436- durable => true ,
1437- auto_delete => false ,
1438- exclusive => false ,
1439- arguments => #{'x-queue-type' => <<" classic" >>}
1440- }], DownQueues ),
1441- assert_item (#{name => <<" foo" >>,
1442- vhost => <<" downvhost" >>,
1443- state => <<" stopped" >>,
1444- durable => true ,
1445- auto_delete => false ,
1446- exclusive => false ,
1447- arguments => #{'x-queue-type' => <<" classic" >>}
1448- }, DownQueue ),
1428+ DownQueueExpected = [#{name => <<" bar" >>,
1429+ vhost => <<" downvhost" >>,
1430+ state => <<" stopped" >>,
1431+ durable => true ,
1432+ auto_delete => false ,
1433+ exclusive => false ,
1434+ arguments => #{'x-queue-type' => <<" classic" >>}
1435+ },
1436+ #{name => <<" foo" >>,
1437+ vhost => <<" downvhost" >>,
1438+ state => <<" stopped" >>,
1439+ durable => true ,
1440+ auto_delete => false ,
1441+ exclusive => false ,
1442+ arguments => #{'x-queue-type' => <<" classic" >>}
1443+ }],
1444+ ? AWAIT (begin
1445+ assert_item (DownVHost , http_get (Config , " /vhosts/downvhost" )),
1446+ assert_list (DownQueueExpected , http_get (Config , " /queues/downvhost" )),
1447+ assert_item (#{name => <<" foo" >>,
1448+ vhost => <<" downvhost" >>,
1449+ state => <<" stopped" >>,
1450+ durable => true ,
1451+ auto_delete => false ,
1452+ exclusive => false ,
1453+ arguments => #{'x-queue-type' => <<" classic" >>}
1454+ },
1455+ http_get (Config , " /queues/downvhost/foo" )),
1456+ true
1457+ end ),
14491458
14501459 http_put (Config , " /queues/badvhost/bar" , Good , ? NOT_FOUND ),
14511460 http_put (Config , " /queues/%2F/bar" ,
0 commit comments