cf 0.6.1.rc15 → 0.6.1.rc16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,19 +96,26 @@ module CF::App
96
96
  seconds = 0
97
97
 
98
98
  begin
99
- while instances = app.instances
100
- indented { print_instances_summary(instances) }
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
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "0.6.1.rc15".freeze
2
+ VERSION = "0.6.1.rc16".freeze
3
3
  end
@@ -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.rc15
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: 2152463802947033801
534
+ hash: 3785386009027622899
535
535
  required_rubygems_version: !ruby/object:Gem::Requirement
536
536
  none: false
537
537
  requirements: