-
-
Notifications
You must be signed in to change notification settings - Fork 390
Description
The TCPSocket#initialize specs will hang if the client socket does not connect to the server, since the shutdown for the server expects that it will have handled a request and be wrapping up here:
https://github.com/ruby/spec/blob/master/library/socket/fixtures/classes.rb#L125-L129
I found this while adding support for the new connect_timeout
keyword; we do not support hash arguments on TCPSocket#initialize at the moment, so the socket never connects. This leaves the server waiting for an incoming connection, and the Thread#join above will hang the suite.
Perhaps we should actively try to close the server socket before we join the thread, and ignore any errors on the thread from a double-close? It would allow these specs to be a bit more robust when there are errors setting up the TCPSocket before connection.