@@ -1538,7 +1538,7 @@ subscribe_from_each(Config) ->
15381538 ok .
15391539
15401540grow_queue (Config ) ->
1541- [Server0 , Server1 , _Server2 , _Server3 , _Server4 ] =
1541+ [Server0 , Server1 , Server2 , _Server3 , _Server4 ] =
15421542 rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
15431543
15441544 Ch = rabbit_ct_client_helpers :open_channel (Config , Server0 ),
@@ -1571,42 +1571,72 @@ grow_queue(Config) ->
15711571
15721572 % % grow queues to node 'Server1'
15731573 TargetClusterSize_2 = 2 ,
1574- rpc :call (Server0 , rabbit_quorum_queue , grow , [Server1 , <<" /" >>, <<" .*" >>, all ]),
1574+ Result1 = rpc :call (Server0 , rabbit_quorum_queue , grow , [Server1 , <<" /" >>, <<" .*" >>, all ]),
1575+ % % [{{resource,<<"/">>,queue,<<"grow_queue">>},{ok,2}},
1576+ % % {{resource,<<"/">>,queue,<<"grow_queue_alt">>},{ok,2}},...]
1577+ ? assert (lists :all (fun ({_ , {R , _ }}) -> R =:= ok end , Result1 )),
15751578 assert_grown_queues (QQs , Server0 , TargetClusterSize_2 , MsgCount ),
15761579
15771580 % % grow queues to quorum cluster size '2' has no effect
1578- rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_2 , <<" /" >>, <<" .*" >>, all ]),
1581+ Result2 = rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_2 , <<" /" >>, <<" .*" >>, all ]),
1582+ ? assertEqual ([], Result2 ),
15791583 assert_grown_queues (QQs , Server0 , TargetClusterSize_2 , MsgCount ),
15801584
15811585 % % grow queues to quorum cluster size '3'
15821586 TargetClusterSize_3 = 3 ,
1583- rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_3 , <<" /" >>, <<" .*" >>, all ]),
1587+ Result3 = rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_3 , <<" /" >>, <<" .*" >>, all , voter ]),
1588+ ? assert (lists :all (fun ({_ , {R , _ }}) -> R =:= ok end , Result3 )),
15841589 assert_grown_queues (QQs , Server0 , TargetClusterSize_3 , MsgCount ),
15851590
15861591 % % grow queues to quorum cluster size '5'
15871592 TargetClusterSize_5 = 5 ,
1588- rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_5 , <<" /" >>, <<" .*" >>, all ]),
1593+ Result4 = rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_5 , <<" /" >>, <<" .*" >>, all , voter ]),
1594+ ? assert (lists :all (fun ({_ , {R , _ }}) -> R =:= ok end , Result4 )),
15891595 assert_grown_queues (QQs , Server0 , TargetClusterSize_5 , MsgCount ),
15901596
1591- % % shrink all queues again
1597+ % % shrink all queues again down to 1 member
15921598 rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_quorum_queue ,
15931599 force_all_queues_shrink_member_to_current_member , []),
15941600 assert_grown_queues (QQs , Server0 , TargetClusterSize_1 , MsgCount ),
15951601
15961602 % % grow queues to quorum cluster size > '5' (limit = 5).
15971603 TargetClusterSize_10 = 10 ,
1598- rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_10 , <<" /" >>, <<" .*" >>, all ]),
1604+ Result5 = rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_10 , <<" /" >>, <<" .*" >>, all ]),
1605+ ? assert (lists :all (fun ({_ , {R , _ }}) -> R =:= ok end , Result5 )),
15991606 assert_grown_queues (QQs , Server0 , TargetClusterSize_5 , MsgCount ),
16001607
1601- % % shrink all queues again
1608+ % % shrink all queues again down to 1 member
16021609 rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_quorum_queue ,
16031610 force_all_queues_shrink_member_to_current_member , []),
16041611 assert_grown_queues (QQs , Server0 , TargetClusterSize_1 , MsgCount ),
16051612
16061613 % % attempt to grow queues to quorum cluster size < '0'.
16071614 BadTargetClusterSize = - 5 ,
16081615 ? assertEqual ({error , bad_quorum_cluster_size },
1609- rpc :call (Server0 , rabbit_quorum_queue , grow , [BadTargetClusterSize , <<" /" >>, <<" .*" >>, all ])).
1616+ rpc :call (Server0 , rabbit_quorum_queue , grow , [BadTargetClusterSize , <<" /" >>, <<" .*" >>, all ])),
1617+
1618+ % % shrink all queues again down to 1 member
1619+ rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_quorum_queue ,
1620+ force_all_queues_shrink_member_to_current_member , []),
1621+ assert_grown_queues (QQs , Server0 , TargetClusterSize_1 , MsgCount ),
1622+
1623+ % % grow queues to node 'Server1': non_voter
1624+ rpc :call (Server0 , rabbit_quorum_queue , grow , [Server1 , <<" /" >>, <<" .*" >>, all , non_voter ]),
1625+ assert_grown_queues (QQs , Server0 , TargetClusterSize_2 , MsgCount ),
1626+
1627+ % % grow queues to node 'Server2': fail, non_voters found
1628+ Result6 = rpc :call (Server0 , rabbit_quorum_queue , grow , [Server2 , <<" /" >>, <<" .*" >>, all , voter ]),
1629+ % % [{{resource,<<"/">>,queue,<<"grow_queue">>},{error, 2, {error, non_voters_found}},
1630+ % % {{resource,<<"/">>,queue,<<"grow_queue_alt">>},{error, 2, {error, non_voters_found}},...]
1631+ ? assert (lists :all (
1632+ fun ({_ , Err }) -> Err =:= {error , TargetClusterSize_2 , {error , non_voters_found }} end , Result6 )),
1633+ assert_grown_queues (QQs , Server0 , TargetClusterSize_2 , MsgCount ),
1634+
1635+ % % grow queues to target quorum cluster size '5': fail, non_voters found
1636+ Result7 = rpc :call (Server0 , rabbit_quorum_queue , grow , [TargetClusterSize_5 , <<" /" >>, <<" .*" >>, all ]),
1637+ ? assert (lists :all (
1638+ fun ({_ , Err }) -> Err =:= {error , TargetClusterSize_2 , {error , non_voters_found }} end , Result7 )),
1639+ assert_grown_queues (QQs , Server0 , TargetClusterSize_2 , MsgCount ).
16101640
16111641assert_grown_queues (Qs , Node , TargetClusterSize , MsgCount ) ->
16121642 [begin
0 commit comments