@@ -149,7 +149,8 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
149149 end
150150
151151 context 'when there are multiple lrps with the same index' do
152- let ( :bbs_actual_lrps_response ) { [ actual_lrp_1 , actual_lrp_2 , actual_lrp_3 , actual_lrp_4 ] }
152+ let ( :desired_instances ) { 3 }
153+ let ( :bbs_actual_lrps_response ) { [ actual_lrp_1 , actual_lrp_2 , actual_lrp_3 , actual_lrp_4 , actual_lrp_5 ] }
153154 let ( :actual_lrp_1 ) do
154155 make_actual_lrp (
155156 instance_guid : '' , index : 0 , state : ::Diego ::ActualLRPState ::UNCLAIMED , error : 'some-details' , since : two_days_ago_since_epoch_ns
@@ -181,14 +182,24 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
181182 end
182183 end
183184
185+ let ( :actual_lrp_5 ) do
186+ make_actual_lrp (
187+ instance_guid : 'instance-c' , index : 2 , state : ::Diego ::ActualLRPState ::RUNNING , error : 'some-details' , since : two_days_ago_since_epoch_ns
188+ ) . tap do |actual_lrp |
189+ actual_lrp . actual_lrp_net_info = lrp_1_net_info
190+ end
191+ end
192+
184193 before do
185194 allow ( bbs_instances_client ) . to receive_messages ( lrp_instances : bbs_actual_lrps_response , desired_lrp_instance : bbs_desired_lrp_response )
186195 end
187196
188197 it 'shows all correct state for all instances' do
189198 result , = instances_reporter . stats_for_app ( process )
199+ expect ( result . length ) . to eq ( 3 )
190200 expect ( result [ 0 ] [ :state ] ) . to eq ( 'DOWN' )
191201 expect ( result [ 1 ] [ :state ] ) . to eq ( 'DOWN' )
202+ expect ( result [ 2 ] [ :state ] ) . to eq ( 'RUNNING' )
192203 end
193204 end
194205
0 commit comments