removing the condition variable around the unix test, as it's probably the cause of the CI hanging

This commit is contained in:
HoneyryderChuck 2020-03-11 00:55:54 +00:00
parent f93ae8d0ae
commit 26017e1f5b
2 changed files with 4 additions and 8 deletions

View File

@ -29,24 +29,17 @@ class UnixTest < Minitest::Test
HTTP
def on_unix_server
mutex = Mutex.new
resource = ConditionVariable.new
path = File.join(Dir.tmpdir, "httpx-unix.sock")
server = UNIXServer.new(path)
begin
th = Thread.start do
mutex.synchronize do
resource.signal
end
socket = server.accept
socket.readpartial(4096) # drain the socket for the request
socket.write(RESPONSE_HEADER)
socket.write("pong")
socket.close
end
mutex.synchronize do
resource.wait(mutex)
end
sleep 0.5
yield server.path
ensure
server.close

View File

@ -26,6 +26,9 @@ CONNECT_TIMEOUT_PORT = ENV.fetch("CONNECT_TIMEOUT_PORT", 9090).to_i
server = TCPServer.new("127.0.0.1", CONNECT_TIMEOUT_PORT)
Thread.abort_on_exception = true if Thread.respond_to?(:abort_on_exception)
Thread.report_on_exception = true if Thread.respond_to?(:report_on_exception)
Thread.start do
begin
sock = server.accept