test/internals_test.rb in redis-3.2.0 vs test/internals_test.rb in redis-3.2.1
- old
+ new
@@ -150,12 +150,15 @@
assert 500_000 > (ruby_usec - redis_usec).abs
end
end
def test_connection_timeout
+ opts = OPTIONS.merge(:host => "10.255.255.254", :connect_timeout => 0.1, :timeout => 5.0)
+ start_time = Time.now
assert_raise Redis::CannotConnectError do
- Redis.new(OPTIONS.merge(:host => "10.255.255.254", :timeout => 0.1)).ping
+ Redis.new(opts).ping
end
+ assert (Time.now - start_time) <= opts[:timeout]
end
def close_on_ping(seq, options = {})
$request = 0