1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
usa 2014-12-25 00:21:00 +00:00
parent aa93c62e3c
commit 86693b30c5
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Thu Dec 25 09:18:55 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
set timeout for recvfrom because if client thread is crashed, it
waits infinity.
Thu Dec 25 08:42:11 2014 Eric Wong <e@80x24.org>
* lib/uri/generic.rb (split_userinfo): fstring for 1-byte split

View file

@ -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