mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
use timeout lib
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fbbf715d27
commit
32f124e68a
1 changed files with 5 additions and 4 deletions
|
@ -160,10 +160,11 @@ class TestResolvDNS < Test::Unit::TestCase
|
||||||
# A rase condition here.
|
# A rase condition here.
|
||||||
# Another program may use the port.
|
# Another program may use the port.
|
||||||
# But no way to prevent it.
|
# But no way to prevent it.
|
||||||
Resolv::DNS.open(:nameserver_port => [[host, port]]) {|dns|
|
timeout(5) do
|
||||||
dns.timeouts = 0.1
|
Resolv::DNS.open(:nameserver_port => [[host, port]]) {|dns|
|
||||||
assert_equal([], dns.getresources("test-no-server.example.org", Resolv::DNS::Resource::IN::A))
|
assert_equal([], dns.getresources("test-no-server.example.org", Resolv::DNS::Resource::IN::A))
|
||||||
}
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_invalid_byte_comment
|
def test_invalid_byte_comment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue