@@ -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 ,
@@ -4014,9 +4015,9 @@ oldest_entry_timestamp(Config) ->
40144015
40154016 ok .
40164017
4017- - define (STATUS_MATCH (N , T ),
4018+ - define (STATUS_MATCH (N , RS , T ),
40184019 [{<<" Node Name" >>, N },
4019- {<<" Raft State" >>, _ },
4020+ {<<" Raft State" >>, RS },
40204021 {<<" Membership" >>, _ },
40214022 {<<" Last Log Index" >>, _ },
40224023 {<<" Last Written" >>, _ },
@@ -4047,9 +4048,9 @@ status(Config) ->
40474048
40484049 % % check that nodes are returned and that at least the term isn't
40494050 % % defaulted (i.e. there was an error)
4050- ? assertMatch ([? STATUS_MATCH (N1 , T1 ),
4051- ? STATUS_MATCH (N2 , T2 ),
4052- ? STATUS_MATCH (N3 , T3 )
4051+ ? assertMatch ([? STATUS_MATCH (N1 , _ , T1 ),
4052+ ? STATUS_MATCH (N2 , _ , T2 ),
4053+ ? STATUS_MATCH (N3 , _ , T3 )
40534054 ] when T1 /= <<>> andalso
40544055 T2 /= <<>> andalso
40554056 T3 /= <<>>,
@@ -4058,6 +4059,34 @@ status(Config) ->
40584059 wait_for_messages (Config , [[QQ , <<" 2" >>, <<" 2" >>, <<" 0" >>]]),
40594060 ok .
40604061
4062+ status_noproc (Config ) ->
4063+ Nodes = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
4064+ [N1 , N2 , N3 ] = lists :sort (Nodes ),
4065+
4066+ Ch = rabbit_ct_client_helpers :open_channel (Config , N1 ),
4067+
4068+ QQ = ? config (queue_name , Config ),
4069+ RaName = ra_name (QQ ),
4070+ ? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
4071+ declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
4072+
4073+ ensure_qq_proc_dead (Config , N1 , RaName ),
4074+ % % simulate that the queue member terminated so early that it
4075+ % % hasn't recorded any counters yet
4076+ rabbit_ct_broker_helpers :rpc (Config , N1 , ra_counters , delete , [{RaName , N1 }]),
4077+
4078+ % % check that some status is returned for each node
4079+ ? assertMatch ([? STATUS_MATCH (N1 , noproc , T1 ),
4080+ ? STATUS_MATCH (N2 , RS2 , T2 ),
4081+ ? STATUS_MATCH (N3 , RS3 , T3 )
4082+ ] when T1 == <<>> andalso
4083+ T2 /= <<>> andalso
4084+ T3 /= <<>> andalso
4085+ (RS2 == leader orelse RS2 == follower ) andalso
4086+ (RS3 == leader orelse RS3 == follower ),
4087+ rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_quorum_queue ,
4088+ status , [<<" /" >>, QQ ])),
4089+ ok .
40614090format (Config ) ->
40624091 % % tests rabbit_quorum_queue:format/2
40634092 Nodes = rabbit_ct_broker_helpers :get_node_configs (Config , nodename ),
0 commit comments