1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

test_rack_handler.rb - try to fix intermittent JRuby CI failures, attempt #2

This commit is contained in:
MSP-Greg 2021-04-11 15:06:41 -05:00
parent 362b4ac7ad
commit cc621bca3f
No known key found for this signature in database
GPG key ID: D688DA4A77D8FA18

View file

@ -33,21 +33,22 @@ class TestPathHandler < Minitest::Test
# Wait for launcher to boot
Timeout.timeout(10) do
sleep 1 until @launcher
sleep 0.5 until @launcher
end
sleep 1.5 unless Puma::IS_MRI
yield @launcher
ensure
@launcher.stop if @launcher
thread.join if thread
thread.join if thread
end
def test_handler_boots
host = windows? ? "127.0.1.1" : "0.0.0.0"
opts = { Host: host }
host = Puma::IS_WINDOWS ? "127.0.0.1" : "0.0.0.0"
port = UniquePort.call
opts = { Host: host, Port: port }
in_handler(app, opts) do |launcher|
hit(["http://#{host}:#{ launcher.connected_ports[0] }/test"])
hit(["http://#{host}:#{port}/test"])
assert_equal("/test", @input["PATH_INFO"])
end
end