mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 02:21:51 +00:00
test: wait for uv.pipe_connect() callback (#37640)
Problem: On Windows, writing to a pipe doesn't work if the pipe isn't connected yet. This causes an RPC request to a session newly created by connect() to hang, as it's waiting for a response to a request that never reaches the server. Solution: Wait for uv.pipe_connect() callback to be called when using connect().
This commit is contained in:
committed by
github-actions[bot]
parent
ddd7494ff9
commit
8fc81bc9e9
@@ -67,8 +67,15 @@ function SocketStream.open(file)
|
||||
_stream_error = nil,
|
||||
}, SocketStream)
|
||||
uv.pipe_connect(socket, file, function(err)
|
||||
uv.stop()
|
||||
self._stream_error = self._stream_error or err
|
||||
end)
|
||||
-- On Windows, writing to the pipe doesn't work if it's not connected yet,
|
||||
-- so wait for the connect callback to be called.
|
||||
uv.run()
|
||||
if self._stream_error then
|
||||
error(self._stream_error)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user