cf 0.6.1.rc15 → 0.6.1.rc16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cf/cli/app/start.rb +15 -8
- data/lib/cf/version.rb +1 -1
- data/spec/cf/cli/app/start_spec.rb +19 -0
- metadata +2 -2
data/lib/cf/cli/app/start.rb
CHANGED
@@ -96,19 +96,26 @@ module CF::App
|
|
96
96
|
seconds = 0
|
97
97
|
|
98
98
|
begin
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
if all_instances_running?(instances)
|
103
|
-
line "#{c("OK", :good)}"
|
104
|
-
return
|
105
|
-
end
|
106
|
-
|
99
|
+
instances = []
|
100
|
+
while true
|
107
101
|
if any_instance_flapping?(instances) || seconds == APP_CHECK_LIMIT
|
108
102
|
err "Application failed to start."
|
109
103
|
return
|
110
104
|
end
|
111
105
|
|
106
|
+
begin
|
107
|
+
return unless instances = app.instances
|
108
|
+
|
109
|
+
indented { print_instances_summary(instances) }
|
110
|
+
|
111
|
+
if all_instances_running?(instances)
|
112
|
+
line "#{c("OK", :good)}"
|
113
|
+
return
|
114
|
+
end
|
115
|
+
rescue CFoundry::NotStaged
|
116
|
+
line "Staging in progress..."
|
117
|
+
end
|
118
|
+
|
112
119
|
sleep 1
|
113
120
|
seconds += 1
|
114
121
|
end
|
data/lib/cf/version.rb
CHANGED
@@ -97,6 +97,25 @@ describe CF::App::Start do
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
context "staging has not completed" do
|
101
|
+
let(:final_instances) do
|
102
|
+
[CFoundry::V2::App::Instance.new(nil, nil, nil, :state => "RUNNING"),
|
103
|
+
CFoundry::V2::App::Instance.new(nil, nil, nil, :state => "RUNNING")
|
104
|
+
]
|
105
|
+
end
|
106
|
+
|
107
|
+
before do
|
108
|
+
stub(app).instances { raise CFoundry::NotStaged.new("Staging is pending", 170002, nil, nil) }
|
109
|
+
end
|
110
|
+
|
111
|
+
it "keeps polling" do
|
112
|
+
subject
|
113
|
+
expect(output).to say("Checking #{app.name}...")
|
114
|
+
expect(output).to say("Staging in progress...")
|
115
|
+
expect(output).to say("2 running")
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
100
119
|
context "when any instance becomes flapping" do
|
101
120
|
let(:final_instances) do
|
102
121
|
[ CFoundry::V2::App::Instance.new(nil, nil, nil, :state => "FLAPPING"),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.1.
|
4
|
+
version: 0.6.1.rc16
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -531,7 +531,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
531
531
|
version: '0'
|
532
532
|
segments:
|
533
533
|
- 0
|
534
|
-
hash:
|
534
|
+
hash: 3785386009027622899
|
535
535
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
536
536
|
none: false
|
537
537
|
requirements:
|