aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems
diff options
context:
space:
mode:
authorJun Aruga <jaruga@redhat.com>2023-12-05 14:07:29 +0900
committergit <svn-admin@ruby-lang.org>2023-12-06 02:49:01 +0000
commit538ff351336ebbee6c0a7987bbbbf8d34cb67d6b (patch)
treee5d5410c8996e463177b53d085bcebc962604235 /test/rubygems
parentd9a1bb4b097899c21c9a11b042072224c4ff252b (diff)
downloadruby-538ff351336ebbee6c0a7987bbbbf8d34cb67d6b.tar.gz
[rubygems/rubygems] test_bundled_ca.rb: Add Net::OpenTimeout as a offline case.
It seems that when DNS connection is enabled, but the TCP connection is disabled in a way, the `Net::HTTP.connect` raises `Net::OpenTimeout`. And I want to skip the tests in this case. https://github.com/ruby/net-http/blob/042faf74e77d786ff60dff81555f6ec4f21e77a9/lib/net/http.rb#L1601-L1608 ``` 1) Error: TestBundledCA#test_accessing_new_index: Net::OpenTimeout: execution expired /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `initialize' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `open' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `block in connect' /builddir/build/BUILD/ruby-3.0.4/lib/timeout.rb:107:in `timeout' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:985:in `connect' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:970:in `do_start' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:959:in `start' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:1512:in `request' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:1270:in `get' /builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_bundled_ca.rb:34:in `assert_https' /builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_bundled_ca.rb:58:in `test_accessing_new_index' ... ``` https://github.com/rubygems/rubygems/commit/5defe0a2f6
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/test_bundled_ca.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/rubygems/test_bundled_ca.rb b/test/rubygems/test_bundled_ca.rb
index 47c1d34df5..ca8e328eb5 100644
--- a/test/rubygems/test_bundled_ca.rb
+++ b/test/rubygems/test_bundled_ca.rb
@@ -33,7 +33,7 @@ class TestGemBundledCA < Gem::TestCase
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.cert_store = bundled_certificate_store
http.get("/")
- rescue Errno::ENOENT, Errno::ETIMEDOUT, SocketError
+ rescue Errno::ENOENT, Errno::ETIMEDOUT, SocketError, Net::OpenTimeout
pend "#{host} seems offline, I can't tell whether ssl would work."
rescue OpenSSL::SSL::SSLError => e
# Only fail for certificate verification errors