From 738c06f9501aef8914ab0c194d59de57923083d6 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 8 Dec 2025 13:06:08 +0100 Subject: [PATCH 1/2] Add Net::Protocol::TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT * To find out efficiently if TCPSocket#initialize supports the open_timeout keyword argument. --- lib/net/protocol.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 1443f3e..8c81298 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -54,6 +54,16 @@ def ssl_socket_connect(s, timeout) s.connect end end + + tcp_socket_parameters = TCPSocket.instance_method(:initialize).parameters + TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT = if tcp_socket_parameters != [[:rest]] + tcp_socket_parameters.include?([:key, :open_timeout]) + else + # Use Socket.tcp to find out since there is no parameters information for TCPSocket#initialize + # See discussion in https://github.com/ruby/net-http/pull/224 + Socket.method(:tcp).parameters.include?([:key, :open_timeout]) + end + private_constant :TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT end From c847e493cba1a39151e20eea7780d3d43936c4b3 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 8 Dec 2025 13:17:51 +0100 Subject: [PATCH 2/2] Use fail-fast: false in CI --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac8950a..1189830 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,7 @@ jobs: needs: ruby-verions name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: + fail-fast: false matrix: ruby: ${{ fromJson(needs.ruby-verions.outputs.versions) }} os: [ ubuntu-latest, macos-latest, windows-latest ]