[前][次][番号順一覧][スレッド一覧]

ruby-changes:61570

From: Kazuhiro <ko1@a...>
Date: Fri, 5 Jun 2020 10:53:18 +0900 (JST)
Subject: [ruby-changes:61570] e17028e48b (master): Add sockets to debug print

https://git.ruby-lang.org/ruby.git/commit/?id=e17028e48b

From e17028e48bcddaef2fb6ded37e8f104886120465 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Fri, 5 Jun 2020 10:48:47 +0900
Subject: Add sockets to debug print

debug print does not include `in_tcp_socket_2`,
so I think other socket connected to server socket.
Add sockets to debug print, and check other socket is in same process or not.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200604T160009Z.fail.html.gz
```
  1) Failure:
IMAPTest#test_connection_closed_without_greeting [/export/home/chkbuild/chkbuild-gcc/tmp/build/20200604T160009Z/ruby/test/net/imap/test_imap.rb:523]:
[Net::IMAP::Error] exception expected, not #<RuntimeError: {:server=>#<TCPServer:(closed)>,
 :port=>35490,
 :server_created=>
  {:server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.30510591},
 :in_start_server_before_accept=>{:t=>45917010.305154555},
 :in_tcp_socket=>
  {:host=>"::1",
   :port=>35490,
   :server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>",
   :t=>45917010.40560127},
 :in_start_server=>
  {:sock_addr=>["AF_INET6", 35490, "::1", "::1"],
   :sock_peeraddr=>["AF_INET6", 51584, "::1", "::1"],
   :t=>45917010.40767231},
 :in_start_server_sock_closed=>{:t=>45917010.40770047},
 :in_rescue=>
  {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:35490>,
   :server_addr=>"::1",
   :t=>45917010.40867455}}
>.
```

diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index 6c6a657..9561fd5 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -511,6 +511,7 @@ class IMAPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/imap/test_imap.rb#L511
           sock_addr: sock.addr,
           sock_peeraddr: sock.peeraddr,
           t: Process.clock_gettime(Process::CLOCK_MONOTONIC),
+          sockets: ObjectSpace.each_object(BasicSocket).map{|s| [s.inspect, connect_address: s.connect_address.inspect, local_address: s.local_address.inspect, remote_address: (s.remote_address rescue nil).inspect] },
         }
         sock.close
         h[:in_start_server_sock_closed] = {
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]