Smoke test should wait up to 5 minutes before it fails
This commit is contained in:
parent
93ed8d2522
commit
34d4712133
|
@ -26,12 +26,21 @@ task "smoke:test" do
|
|||
request.basic_auth(ENV['AUTH_USER'], ENV['AUTH_PASSWORD'])
|
||||
end
|
||||
|
||||
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
||||
http.request(request)
|
||||
end
|
||||
start = Time.now
|
||||
while true
|
||||
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
||||
http.request(request)
|
||||
end
|
||||
|
||||
if response.code != "200"
|
||||
raise "TRIVIAL GET FAILED WITH #{response.code}"
|
||||
break if response.code == "200"
|
||||
|
||||
# retry for up to 5 minutes
|
||||
if Time.now - start < 300
|
||||
puts "Connection failed with #{response.code}. Retrying in 5 seconds..."
|
||||
sleep(5)
|
||||
else
|
||||
raise "TRIVIAL GET FAILED WITH #{response.code}"
|
||||
end
|
||||
end
|
||||
|
||||
results = ""
|
||||
|
|
Loading…
Reference in New Issue