From 86693b30c53ea750d0f1e1a7210476ec9c9f8374 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 25 Dec 2014 00:21:00 +0000 Subject: * test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address): set timeout for recvfrom because if client thread is crashed, it waits infinity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/resolv/test_dns.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/resolv/test_dns.rb') diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb index f3f6ec212f..da7fa43dbc 100644 --- a/test/resolv/test_dns.rb +++ b/test/resolv/test_dns.rb @@ -53,7 +53,9 @@ class TestResolvDNS < Test::Unit::TestCase } } server_thread = Thread.new { - msg, (_, client_port, _, client_address) = u.recvfrom(4096) + timeout(5) do + msg, (_, client_port, _, client_address) = u.recvfrom(4096) + end id, word2, qdcount, ancount, nscount, arcount = msg.unpack("nnnnnn") qr = (word2 & 0x8000) >> 15 opcode = (word2 & 0x7800) >> 11 -- cgit v1.2.3