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'])
|
request.basic_auth(ENV['AUTH_USER'], ENV['AUTH_PASSWORD'])
|
||||||
end
|
end
|
||||||
|
|
||||||
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
start = Time.now
|
||||||
http.request(request)
|
while true
|
||||||
end
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
||||||
|
http.request(request)
|
||||||
|
end
|
||||||
|
|
||||||
if response.code != "200"
|
break if response.code == "200"
|
||||||
raise "TRIVIAL GET FAILED WITH #{response.code}"
|
|
||||||
|
# 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
|
end
|
||||||
|
|
||||||
results = ""
|
results = ""
|
||||||
|
|
Loading…
Reference in New Issue