ruby-changes:59262
From: Kazuhiro <ko1@a...>
Date: Sun, 15 Dec 2019 20:10:56 +0900 (JST)
Subject: [ruby-changes:59262] a83c46e3fd (master): Add more debug info
https://git.ruby-lang.org/ruby.git/commit/?id=a83c46e3fd From a83c46e3fd1e3480404c6dda4c4cda73533a6a1d Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Sun, 15 Dec 2019 20:03:47 +0900 Subject: Add more debug info closed server doesn't have useful info. So call inspect before close. And add local debug code in comment. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191215T092405Z.fail.html.gz ``` 1) Failure: IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20191215T092405Z/ruby/test/net/imap/test_imap.rb:483]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:41748>, :server=>#<TCPServer:(closed)>, :port=>41748, :server_addr=>"::1"}>. ``` diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb index 850974f..33b305e 100644 --- a/test/net/imap/test_imap.rb +++ b/test/net/imap/test_imap.rb @@ -472,18 +472,25 @@ class IMAPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/imap/test_imap.rb#L472 def test_connection_closed_without_greeting server = create_tcp_server port = server.addr[1] + h = {'server before close': server.inspect} # inspect info before close start_server do begin sock = server.accept + h[:sock_addr], h[:sock_peeraddr] = sock.addr, sock.peeraddr sock.close ensure server.close end end assert_raise(Net::IMAP::Error) do + #begin Net::IMAP.new(server_addr, :port => port) + #rescue Net::IMAP::Error + # raise Errno::EINVAL + #end rescue Errno::EINVAL => e # for debug on OpenCSW - raise({e: e, server: server, port: port, server_addr: server_addr}.inspect) + h.merge!({e: e, server: server, port: port, server_addr: server_addr}) + raise(h.inspect) end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/