Commit 2fa30478 authored by Ash McKenzie's avatar Ash McKenzie

Use higher level status to determine readiness

parent 730ace4f
......@@ -138,12 +138,10 @@ module QA
Time.new.tap do |start|
while Time.new - start < 120
begin
Net::HTTP.get(URI.join(@address, '/-/readiness')).tap do |body|
if JSON.parse(body).all? { |_, service| service['status'] == 'ok' }
return puts "\nSecondary ready after #{Time.now - start} seconds." # rubocop:disable Cop/AvoidReturnFromBlocks
else
print '.'
end
if host_ready?
return puts "\nSecondary ready after #{Time.now - start} seconds." # rubocop:disable Cop/AvoidReturnFromBlocks
else
print '.'
end
rescue StandardError
print 'e'
......@@ -168,6 +166,13 @@ module QA
QA::Page::Main::Menu.perform(&:sign_out)
end
end
private
def host_ready?
body = Net::HTTP.get(URI.join(@address, '/-/readiness'))
JSON.parse(body)['status'] == 'ok'
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment