aboutsummaryrefslogtreecommitdiffstats
path: root/test/socket/test_socket.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket/test_socket.rb')
-rw-r--r--test/socket/test_socket.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 630618a7bc..b54c92dec2 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -251,6 +251,9 @@ class TestSocket < Test::Unit::TestCase
Addrinfo.udp(ai.ip_address, port).connect {|s|
msg1 = "<<<#{ai.inspect}>>>"
s.sendmsg msg1
+ unless IO.select([s], nil, nil, 10)
+ raise "no response"
+ end
msg2, addr = s.recvmsg
msg2, remote_address, local_address = Marshal.load(msg2)
assert_equal(msg1, msg2)
@@ -260,7 +263,11 @@ class TestSocket < Test::Unit::TestCase
ensure
if th
Addrinfo.udp("127.0.0.1", port).connect {|s| s.sendmsg "exit" }
- th.join
+ unless th.join(10)
+ Thread.kill th
+ th.join(10)
+ raise "thread killed"
+ end
end
end
}