File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
lib/cloud_controller/deployment_updater/actions
spec/unit/lib/cloud_controller/deployment_updater/actions Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ def call
2828
2929 app . lock!
3030
31- oldest_web_process_with_instances . lock!
32- deploying_web_process . lock!
31+ app . web_processes . each ( &:lock! )
3332
3433 deployment . update (
3534 status_value : DeploymentModel ::ACTIVE_STATUS_VALUE ,
@@ -52,11 +51,6 @@ def call
5251
5352 private
5453
55- def oldest_web_process_with_instances
56- # TODO: lock all web processes? We might alter all of them, depending on max-in-flight size
57- @oldest_web_process_with_instances ||= app . web_processes . select { |process | process . instances > 0 } . min_by { |p | [ p . created_at , p . id ] }
58- end
59-
6054 def instance_count_summary
6155 @instance_count_summary ||= instance_reporters . instance_count_summary ( deploying_web_process )
6256 end
Original file line number Diff line number Diff line change @@ -89,6 +89,15 @@ module VCAP::CloudController
8989 } . by ( 1 )
9090 end
9191
92+ context 'when the app has been scaled to 0 instances' do
93+ let ( :current_web_instances ) { 0 }
94+ let ( :target_total_instance_count ) { 0 }
95+
96+ it 'finishes scaling' do
97+ expect ( subject . call ) . to be true
98+ end
99+ end
100+
92101 context 'when the max_in_flight is set to 2' do
93102 let ( :deployment ) do
94103 DeploymentModel . make (
You can’t perform that action at this time.
0 commit comments