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
28
28
29
29
app . lock!
30
30
31
- oldest_web_process_with_instances . lock!
32
- deploying_web_process . lock!
31
+ app . web_processes . each ( &:lock! )
33
32
34
33
deployment . update (
35
34
status_value : DeploymentModel ::ACTIVE_STATUS_VALUE ,
@@ -52,11 +51,6 @@ def call
52
51
53
52
private
54
53
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
-
60
54
def instance_count_summary
61
55
@instance_count_summary ||= instance_reporters . instance_count_summary ( deploying_web_process )
62
56
end
Original file line number Diff line number Diff line change @@ -89,6 +89,15 @@ module VCAP::CloudController
89
89
} . by ( 1 )
90
90
end
91
91
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
+
92
101
context 'when the max_in_flight is set to 2' do
93
102
let ( :deployment ) do
94
103
DeploymentModel . make (
You can’t perform that action at this time.
0 commit comments