mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Rescue another http error in qunit task (#23651)
Should take care of a flake issue. Also removes an extraneous `/` character in the used URL.
This commit is contained in:
@@ -83,13 +83,16 @@ task "qunit:test", %i[timeout qunit_path filter] do |_, args|
|
||||
|
||||
# wait for server to accept connections
|
||||
require "net/http"
|
||||
warmup_path = "/srv/status"
|
||||
uri = URI("http://localhost:#{unicorn_port}/#{warmup_path}")
|
||||
uri = URI("http://localhost:#{unicorn_port}/srv/status")
|
||||
puts "Warming up Rails server"
|
||||
|
||||
begin
|
||||
Net::HTTP.get(uri)
|
||||
rescue Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL, Net::ReadTimeout, EOFError
|
||||
rescue Errno::ECONNREFUSED,
|
||||
Errno::EADDRNOTAVAIL,
|
||||
Net::ReadTimeout,
|
||||
Net::HTTPBadResponse,
|
||||
EOFError
|
||||
sleep 1
|
||||
retry if elapsed() <= 60
|
||||
puts "Timed out. Can not connect to forked server!"
|
||||
|
||||
Reference in New Issue
Block a user