Browse files

retry couple times when pushing an app

  • Loading branch information...
1 parent 4b10cfc commit b9f41a12a4bfea0531d76dcabbd1fc5e0ae19381 Dmitriy Kalinin and Mark Rushakoff committed Mar 25, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/harness/app.rb
View
10 lib/harness/app.rb
@@ -93,12 +93,22 @@ def start(need_check = true, async = false, &blk)
unless @app.running?
@log.info "Start App: #{@app.name}"
+ timeout_retries_remaining = 5
begin
@app.start!(true) do |url|
puts "Pushing #{@app.name} - #{url}"
blk.call(url) if blk
end
+
+ # When ccng/dea_ng are overloaded app staging will result
+ # in nginx cutting off api request. Goal here is to make
+ # tests resilient to such failure; however, we want to
+ # report such failures at the end.
+ rescue CFoundry::Timeout => e
+ timeout_retries_remaining -= 1
+ timeout_retries_remaining > 0 ? retry : raise
+
rescue Exception => e
# Use e.inspect to capture both message and error class
msg = <<-MSG

0 comments on commit b9f41a1

Please sign in to comment.