Author: Apollon Oikonomopoulos <apoikos@debian.org>
Description: Disable network tests using routable IPs
 We disable two network tests using a routable IP address (1.1.1.1) to trigger
 a connection timeout. 1.1.1.1 is not guaranteed to be unroutable, and even in
 that case, connecting to it might yield different results (timeout, connection
 refused, host unreachable).

Forwarded: no
Last-Update: 2014-04-14
--- a/test/connection_test.rb
+++ b/test/connection_test.rb
@@ -104,27 +104,30 @@
     end
   end
 
-  def test_connect_tcp_with_timeout
-    hiredis.timeout = 200_000
+  ## The following tests do not work reliably with all possible environments.
+  # Connecting to 1.1.1.1 may - among other things - succeed or yield a
+  # connection refused or host unreachable error.
+  #def test_connect_tcp_with_timeout
+  #  hiredis.timeout = 200_000
+
+  #  t = Time.now
+  #  assert_raise Errno::ETIMEDOUT do
+  #    hiredis.connect("1.1.1.1", 59876)
+  #  end
+
+  #  assert 210_000 > (Time.now - t)
+  #end
+
+  #def test_connect_tcp_with_timeout_override
+  #  hiredis.timeout = 1_000_000
+
+  #  t = Time.now
+  #  assert_raise Errno::ETIMEDOUT do
+  #    hiredis.connect("1.1.1.1", 59876, 200_000)
+  #  end
 
-    t = Time.now
-    assert_raise Errno::ETIMEDOUT do
-      hiredis.connect("1.1.1.1", 59876)
-    end
-
-    assert 210_000 > (Time.now - t)
-  end
-
-  def test_connect_tcp_with_timeout_override
-    hiredis.timeout = 1_000_000
-
-    t = Time.now
-    assert_raise Errno::ETIMEDOUT do
-      hiredis.connect("1.1.1.1", 59876, 200_000)
-    end
-
-    assert 210_000 > (Time.now - t)
-  end
+  #  assert 210_000 > (Time.now - t)
+  #end
 
   def test_connect_tcp_without_timeout
     hiredis.timeout = 0
