diff options
| author | Misaki Shioi <31817032+shioimm@users.noreply.github.com> | 2025-12-19 15:44:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-19 15:44:35 +0900 |
| commit | 47244b0f306161f175b21f74d801882e950e18be (patch) | |
| tree | 765af248b9f1acc1d8af4fbfa4f6d58eb04833f4 /test/socket | |
| parent | f81c62be3df7b29c4c3b6adaa16599b38d0c0c46 (diff) | |
Fix: Specifying 0 should cause an immediate timeout (#15641)
This change fixes a bug in which specifying 0 for timeout-related options (such as the `timeout` option of `Addrinfo.getaddrinfo`) incorrectly results in an infinite wait.
(This change overwrites https://github.com/ruby/ruby/pull/15626 .)
Diffstat (limited to 'test/socket')
| -rw-r--r-- | test/socket/test_socket.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index 686114f05c..c42527f370 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -1011,7 +1011,7 @@ class TestSocket < Test::Unit::TestCase Addrinfo.define_singleton_method(:getaddrinfo) do |_, _, family, *_| case family when Socket::AF_INET6 then raise SocketError - when Socket::AF_INET then sleep(0.001); raise SocketError, "Last hostname resolution error" + when Socket::AF_INET then sleep(0.01); raise SocketError, "Last hostname resolution error" end end |
