mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-09-24 00:01:14 -04:00
removing the condition variable around the unix test, as it's probably the cause of the CI hanging
This commit is contained in:
parent
f93ae8d0ae
commit
26017e1f5b
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user