Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Revert "Revert "Increase timeout when waiting for log messages""
Browse files Browse the repository at this point in the history
This fixes the previously-broken nyets that the services team uses.

This reverts commit 394b606.
  • Loading branch information
Matt Royal committed Jan 1, 2014
1 parent 394b606 commit b3c6429
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -6,7 +6,7 @@ gem 'ci_reporter'
gem 'cfoundry', '~> 4.0.4.rc2'
gem 'cf-uaa-lib'
gem 'httparty'
gem 'blue-shell'
gem 'blue-shell', '~> 0.3.0'
gem 'parallel_tests'

group :monitoring do
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -7,7 +7,7 @@ GEM
activesupport (3.2.14)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
blue-shell (0.2.2)
blue-shell (0.3.0)
rspec
builder (3.0.4)
cf-uaa-lib (1.3.10)
Expand Down Expand Up @@ -49,7 +49,7 @@ PLATFORMS
ruby

DEPENDENCIES
blue-shell
blue-shell (~> 0.3.0)
cf-uaa-lib
cfoundry (~> 4.0.4.rc2)
ci_reporter
Expand Down
4 changes: 3 additions & 1 deletion services_spec/managing_a_service_spec.rb
Expand Up @@ -49,7 +49,9 @@
runner.should say "Bind other services to application?>"
runner.send_keys "n"

runner.should say "Uploading #{app_name}... OK", 180
runner.with_timeout 180 do
runner.should say "Uploading #{app_name}... OK"
end
end

set_app_signature_env_variable(app_name)
Expand Down
4 changes: 3 additions & 1 deletion services_spec/service_connector_spec.rb
Expand Up @@ -53,7 +53,9 @@
runner.should say "Bind other services to application?>"
runner.send_keys "n"

runner.should say "Uploading #{app_name}... OK", 180
runner.with_timeout 180 do
runner.should say "Uploading #{app_name}... OK"
end
end

set_app_signature_env_variable(app_name)
Expand Down
16 changes: 9 additions & 7 deletions spec/loggregator_spec.rb
Expand Up @@ -52,13 +52,15 @@ def check_loggregator_works
puts "starting #{__method__} (#{Time.now})"

BlueShell::Runner.run("gcf logs #{app_name}") do |runner|
runner.should say "Connected, tailing logs for app #{app_name}"

# Hit twice to see that both router and app messages come through; order is not guaranteed
page_content
runner.should say "[RTR]"
page_content
runner.should say "[App/0]"
runner.with_timeout 60 do
runner.should say "Connected, tailing logs for app #{app_name}"

# Hit twice to see that both router and app messages come through; order is not guaranteed
page_content
runner.should say "[RTR]"
page_content
runner.should say "[App/0]"
end
end
end

Expand Down
24 changes: 18 additions & 6 deletions spec/support/cf_helpers.rb
Expand Up @@ -59,20 +59,26 @@ def login

cmd = "#{cf_bin} login #{username} --password #{password} -o #{org.name} -s #{space.name}"
BlueShell::Runner.run(cmd) do |runner|
runner.wait_for_exit 60
runner.with_timeout 60 do
runner.wait_for_exit
end
end
end

def logout
BlueShell::Runner.run("#{cf_bin} logout") do |runner|
runner.wait_for_exit 60
runner.with_timeout 60 do
runner.wait_for_exit
end
end
end

def set_target
target = ENV['NYET_TARGET']
BlueShell::Runner.run("#{cf_bin} target #{target}") do |runner|
runner.wait_for_exit(20)
runner.with_timeout 20 do
runner.wait_for_exit
end
end
end

Expand Down Expand Up @@ -116,14 +122,20 @@ def use_newest_cf

def set_app_signature_env_variable(app_name)
BlueShell::Runner.run("#{cf_bin} set-env #{app_name} APP_SIGNATURE #{app_signature}") do |runner|
runner.should say "Updating env variable APP_SIGNATURE for app #{app_name}... OK", 180
runner.with_timeout 180 do
runner.should say "Updating env variable APP_SIGNATURE for app #{app_name}... OK"
end
end
end

def start_app(app_name)
BlueShell::Runner.run("#{cf_bin} start --trace #{app_name} 2>>#{tmp_dir}/cf_trace.log") do |runner|
runner.should say "Preparing to start #{app_name}... OK", 180
runner.should say "Checking status of app '#{app_name}'", 180
runner.with_timeout 180 do
runner.should say "Preparing to start #{app_name}... OK"
end
runner.with_timeout 180 do
runner.should say "Checking status of app '#{app_name}'"
end
runner.should say "1 of 1 instances running"
runner.should say "Push successful"
end
Expand Down

0 comments on commit b3c6429

Please sign in to comment.