summaryrefslogtreecommitdiff
path: root/test/resolv/test_dns.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 00:21:00 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 00:21:00 +0000
commit86693b30c53ea750d0f1e1a7210476ec9c9f8374 (patch)
treeac1c716715cd7bef88067826cb7d739fe4b39526 /test/resolv/test_dns.rb
parentaa93c62e3cc2bb158b66489cd23e3f90ddb826e7 (diff)
* 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
Diffstat (limited to 'test/resolv/test_dns.rb')
-rw-r--r--test/resolv/test_dns.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb
index f3f6ec2..da7fa43 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