@@ -92,6 +92,7 @@ groups() ->
9292 leader_locator_balanced_random_maintenance ,
9393 leader_locator_policy ,
9494 status ,
95+ status_noproc ,
9596 format ,
9697 add_member_2 ,
9798 single_active_consumer_priority_take_over ,
@@ -4050,9 +4051,9 @@ oldest_entry_timestamp(Config) ->
40504051
40514052 ok .
40524053
4053- - define (STATUS_MATCH (N , T ),
4054+ - define (STATUS_MATCH (N , RS , T ),
40544055 [{<<" Node Name" >>, N },
4055- {<<" Raft State" >>, _ },
4056+ {<<" Raft State" >>, RS },
40564057 {<<" Membership" >>, _ },
40574058 {<<" Last Log Index" >>, _ },
40584059 {<<" Last Written" >>, _ },
@@ -4083,9 +4084,9 @@ status(Config) ->
40834084
40844085 % % check that nodes are returned and that at least the term isn't
40854086 % % defaulted (i.e. there was an error)
4086- ? assertMatch ([? STATUS_MATCH (N1 , T1 ),
4087- ? STATUS_MATCH (N2 , T2 ),
4088- ? STATUS_MATCH (N3 , T3 )
4087+ ? assertMatch ([? STATUS_MATCH (N1 , _ , T1 ),
4088+ ? STATUS_MATCH (N2 , _ , T2 ),
4089+ ? STATUS_MATCH (N3 , _ , T3 )
40894090 ] when T1 /= <<>> andalso
40904091 T2 /= <<>> andalso
40914092 T3 /= <<>>,
@@ -4094,6 +4095,34 @@ status(Config) ->
40944095 wait_for_messages (Config , [[QQ , <<" 2" >>, <<" 2" >>, <<" 0" >>]]),
40954096 ok .
40964097
4098+ status_noproc (Config ) ->
4099+ Nodes = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
4100+ [N1 , N2 , N3 ] = lists :sort (Nodes ),
4101+
4102+ Ch = rabbit_ct_client_helpers :open_channel (Config , N1 ),
4103+
4104+ QQ = ? config (queue_name , Config ),
4105+ RaName = ra_name (QQ ),
4106+ ? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
4107+ declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
4108+
4109+ ensure_qq_proc_dead (Config , N1 , RaName ),
4110+ % % simulate that the queue member terminated so early that it
4111+ % % hasn't recorded any counters yet
4112+ rabbit_ct_broker_helpers :rpc (Config , N1 , ra_counters , delete , [{RaName , N1 }]),
4113+
4114+ % % check that some status is returned for each node
4115+ ? assertMatch ([? STATUS_MATCH (N1 , noproc , T1 ),
4116+ ? STATUS_MATCH (N2 , RS2 , T2 ),
4117+ ? STATUS_MATCH (N3 , RS3 , T3 )
4118+ ] when T1 == <<>> andalso
4119+ T2 /= <<>> andalso
4120+ T3 /= <<>> andalso
4121+ (RS2 == leader orelse RS2 == follower ) andalso
4122+ (RS3 == leader orelse RS3 == follower ),
4123+ rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_quorum_queue ,
4124+ status , [<<" /" >>, QQ ])),
4125+ ok .
40974126format (Config ) ->
40984127 % % tests rabbit_quorum_queue:format/2
40994128 Nodes = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
0 commit comments