[Ruby 1.9 - Bug #5151][Open] test/socket/test_socket.rb fail when udp connection failed

Issue #5151 has been reported by Ayumu AIZAWA.


Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Open
Priority: Normal
Assignee:
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2011-08-03 revision 32820) [x86_64-darwin10.8.0]

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

2011/8/3 Ayumu AIZAWA [email protected]:

test/socket/test_socket.rb $B$N(B test_udp_server $BFb$G(B
Socket.ip_address_list $B$GF@$i$l$k(B
$B%"%I%l%9$KBP$7$F@\B3$G$-$J$$$H$-$K(B RuntimeError $B$G%F%9%H$,<:GT$7$^$9!#(B

$BF1$8%F%9%H%U%!%$%k$NCf$N(B test_ip_address_list
[email protected]$7$F$$$k$N$G!"<hF@$7$F$$$k%j%9%H(B

$B$NCf?H<+BN$OLdBj$J$5$=$&$J$N$G!"@\B3$G$-$J$$$H$-$O%9%-%C%W$7$F$7$^$C$F$h$$$N$G$O(B

$B$J$$$+$H$*$b$$$^$7$?!#(B

test_ip_address_list $B$,@.8y$9$k$3$H$O(B
test_udp_server $B$G%9%-%C%W$7$FNI$$M}M3$K$O$J$i$J$$$H;W$$$^$9!#(B

$B$^$:!"$J$s$G<:GT$9$k$s$G$7$g$&$+!#(B

$B$A$J$_$K!"(BOpenBSD $B$G$O(B ($B$*$=$i$/(B) OS
$B$N%P%0$G<:GT$7$^$9!#(B
[ruby-core:38603]

2011/8/3 Ayumu AIZAWA [email protected]:

test/socket/test_socket.rb $B$N(B test_udp_server $BFb$G(B
Socket.ip_address_list $B$GF@$i$l$k(B
$B%"%I%l%9$KBP$7$F@\B3$G$-$J$$$H$-$K(B RuntimeError $B$G%F%9%H$,<:GT$7$^$9!#(B

$BF1$8%F%9%H%U%!%$%k$NCf$N(B test_ip_address_list
[email protected]$7$F$$$k$N$G!"<hF@$7$F$$$k%j%9%H(B

$B$NCf?H<+BN$OLdBj$J$5$=$&$J$N$G!"@\B3$G$-$J$$$H$-$O%9%-%C%W$7$F$7$^$C$F$h$$$N$G$O(B

$B$J$$$+$H$*$b$$$^$7$?!#(B

test_ip_address_list $B$,@.8y$9$k$3$H$O(B
test_udp_server $B$G%9%-%C%W$7$FNI$$M}M3$K$O$J$i$J$$$H;W$$$^$9!#(B

$B$^$:!"$J$s$G<:GT$9$k$s$G$7$g$&$+!#(B

$B$A$J$_$K!"(BOpenBSD $B$G$O(B ($B$*$=$i$/(B) OS
$B$N%P%0$G<:GT$7$^$9!#(B
[ruby-core:38603]

あいざわです

まず、なんで失敗するんでしょうか。

ちなみに、OpenBSD では (おそらく) OS のバグで失敗します。
[ruby-core:38603]
わたしの環境の方の問題ですかね。
ちなみに Mac OS X 10.6.8 で実行しました。

ip_address_list でとってきているアドレスは
“::1”,
“fe80::1%lo0”,
“127.0.0.1”,
“fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300”,
“fe80::223:6cff:fe80:7ff5%en1”,
“192.168.1.11”,
“2001:c90:a8c:86c6:223:6cff:fe80:7ff5”,
“172.16.20.1”,
“172.16.126.1”,
“fe80::223:32ff:feb4:f300%utun0”,
“fd00:6587:52d7:f8d6:223:32ff:feb4:f300”

の11個で、4番目のアドレスに接続するときに失敗するようです。
接続先のポートはいずれも 65036 です。

会社に Ubuntuがあるのでそちらでも試してみます。

Issue #5151 has been updated by Motohiro KOSAKI.

Status changed from Open to Feedback


Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version: 1.9.3
ruby -v: -

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by Motohiro KOSAKI.

Category set to ext
Status changed from Feedback to Assigned
Assignee set to Kenta M.

Mac固有の問題のようなので、むらけんさんにassignします。

Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Assigned
Priority: Normal
Assignee: Kenta M.
Category: ext
Target version: 1.9.3
ruby -v: -

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by Motohiro KOSAKI.

むらたさん

regressionではないようですし、見る時間がなさそうであれば1.9.4に送ってしまってください。僕は時間がないので当分見る予定ないです

Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Assigned
Priority: Normal
Assignee: Kenta M.
Category: ext
Target version: 1.9.3
ruby -v: -

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

むらたです。

On Saturday, August 20, 2011 at 19:07 , Motohiro KOSAKI wrote:

むらたさん

regressionではないようですし、見る時間がなさそうであれば1.9.4に送ってしまってください。僕は時間がないので当分見る予定ないです

わかりました。


Kenta M.
Sent with Sparrow (http://www.sparrowmailapp.com)

Issue #5151 has been updated by Ayumu AIZAWA.

=begin

Ubuntu 11.04で試してみたところ再現しませんでした。
とりいそぎご報告まで。

ayumin@Ubuntu11:~/github/ruby$ uname -a
Linux Ubuntu11 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux
ayumin@Ubuntu11:~/github/ruby$ ./ruby -v
ruby 1.9.3dev (2011-08-08 revision 32887) [x86_64-linux]
ayumin@Ubuntu11:~/github/ruby$ make test-all TESTS=‘-v
test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems” -v
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems” -v

Running tests:

TestSocket#test_accept_loop = 0.00 s = .
TestSocket#test_accept_loop_multi_port = 0.00 s = .
TestSocket#test_accept_loop_with_unix = 0.00 s = .
TestSocket#test_bintime = 0.00 s = .
TestSocket#test_closed_read = 0.20 s = .
TestSocket#test_getaddrinfo = 0.00 s = .
TestSocket#test_getaddrinfo_raises_no_errors_on_port_argument_of_0 =
0.00 s = .
TestSocket#test_getnameinfo = 0.00 s = .
TestSocket#test_initialize = 0.00 s = .
TestSocket#test_ip_address_list = 0.00 s = .
TestSocket#test_linger = 0.00 s = .
TestSocket#test_socket_new = 0.00 s = .
TestSocket#test_sysaccept = 0.00 s = .
TestSocket#test_tcp = 0.00 s = .
TestSocket#test_tcp_server_sockets = 0.00 s = .
TestSocket#test_tcp_server_sockets_port0 = 0.00 s = .
TestSocket#test_timestamp = 0.00 s = .
TestSocket#test_timestampns = 0.00 s = .
TestSocket#test_udp_server = 0.00 s = .
TestSocket#test_unix = 0.00 s = .
TestSocket#test_unix_server_socket = 0.00 s = .
TestSocket#test_unpack_sockaddr = 0.00 s = .

Finished tests in 0.227361s, 96.7626 tests/s, 294.6861 assertions/s.

22 tests, 67 assertions, 0 failures, 0 errors, 0 skips
=end

Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version: 1.9.3
ruby -v: -

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by Kenta M…

Target version changed from 1.9.3 to 1.9.4


Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Assigned
Priority: Normal
Assignee: Kenta M.
Category: ext
Target version: 1.9.4
ruby -v: -

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by Ayumu AIZAWA.

あいざわです。

SnowLeopard に固有の問題かと思ったのですが、友人の協力を得て別のマシンでテストしたところ再現しませんでした。
何が原因なんだろうか … チェックすべき設定などあったらご教示いただけませんでしょうか。

$ make test-all TESTS=‘-v test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems” -v
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems” -v

Running tests:

TestSocket#test_accept_loop = 0.00 s = .
TestSocket#test_accept_loop_multi_port = 0.00 s = .
TestSocket#test_accept_loop_with_unix = 0.00 s = .
TestSocket#test_bintime = 0.00 s = .
TestSocket#test_closed_read = 0.20 s = .
TestSocket#test_connect_timeout = 0.00 s = .
TestSocket#test_getaddrinfo = 0.00 s = .
TestSocket#test_getaddrinfo_raises_no_errors_on_port_argument_of_0 =
0.00 s = .
TestSocket#test_getnameinfo = 0.00 s = .
TestSocket#test_initialize = 0.00 s = .
TestSocket#test_ip_address_list = 0.00 s = .
TestSocket#test_linger = 0.00 s = .
TestSocket#test_socket_new = 0.00 s = .
TestSocket#test_sysaccept = 0.00 s = .
TestSocket#test_tcp = 0.00 s = .
TestSocket#test_tcp_server_sockets = 0.00 s = .
TestSocket#test_tcp_server_sockets_port0 = 0.00 s = .
TestSocket#test_timestamp = 0.00 s = .
TestSocket#test_timestampns = 0.00 s = .
TestSocket#test_udp_server = 0.01 s = .
TestSocket#test_unix = 0.00 s = .
TestSocket#test_unix_server_socket = 0.00 s = .
TestSocket#test_unpack_sockaddr = 0.00 s = .

Finished tests in 0.236844s, 97.1103 tests/s, 422.2188 assertions/s.

23 tests, 100 assertions, 0 failures, 0 errors, 0 skips

ruby -v: ruby 1.9.4dev (2011-09-10 trunk 33245) [x86_64-darwin10.8.0]

$ ./ruby -v
ruby 1.9.4dev (2011-09-10 trunk 33245) [x86_64-darwin10.8.0]

$ uname -a
Darwin mbp-akitsukada.local 10.8.0 Darwin Kernel Version 10.8.0: Tue
Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386


Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Assigned
Priority: Normal
Assignee: Kenta M.
Category: ext
Target version: 1.9.4
ruby -v: -

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by Kenta M…

ruby -v changed from - to - (darwin)


Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Assigned
Priority: Normal
Assignee: Kenta M.
Category: ext
Target version: 1.9.4
ruby -v: - (darwin)

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

2011/9/10 Ayumu AIZAWA [email protected]:

$B2?$,860x$J$s$@$m$&$+(B …
$B%A%'%C%/$9$Y$-@_Dj$J$I$"$C$?$i$465<($$$?$@$1$^$;$s$G$7$g$&$+!#(B

boron $B$G$N7P83$K$D$$$F=R$Y$l$P!"%Q%1%C%H%U%#%k%?$H$+!#(B

Issue #5151 has been updated by Ayumu AIZAWA.

Wifiをオフにしてスタンドアロン状態でテストしたら再現しなくなりました。

Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: Ayumu AIZAWA
Status: Assigned
Priority: Normal
Assignee: Kenta M.
Category: ext
Target version: 1.9.4
ruby -v: - (darwin)

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by ayumin (Ayumu AIZAWA).

Mac OSX Lion(Darwin Kernel Version 11.3.0) では、r35509 で再現しなくなっていました。

Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: ayumin (Ayumu AIZAWA)
Status: Assigned
Priority: Normal
Assignee: mrkn (Kenta M.)
Category: ext
Target version: 1.9.4
ruby -v: - (darwin)

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end

Issue #5151 has been updated by naruse (Yui NARUSE).

Status changed from Assigned to Closed

まず、原因の累計として、

  • OS のバグ (CentOS 5.6 や OpenBSD)
  • 通信が無効になっている (FreeBSD9 の IFDISABLED、POINTOPOINT など)

後者は ifconfig の結果を眺めつつ、man を読むとわかったりわからなかったりします。
r35610 や r35611 ではこの辺の対策を入れています。

元々の問題である “fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300” がなぜダメだったかは
わからないのですが、最近聞かない辺り、バグだったんですかねぇ。
とりあえず、getifaddrs で取ってきたやつに対して ioctl したり、
FreeBSD の ifconfig 眺めて色々着いてるオプションを眺めるという技は習得したんですが。

Bug #5151: test/socket/test_socket.rb fail when udp connection failed

Author: ayumin (Ayumu AIZAWA)
Status: Closed
Priority: Normal
Assignee: mrkn (Kenta M.)
Category: ext
Target version: 1.9.4
ruby -v: - (darwin)

=begin
test/socket/test_socket.rb の test_udp_server 内で Socket.ip_address_list
で得られる
アドレスに対して接続できないときに RuntimeError でテストが失敗します。

同じテストファイルの中の test_ip_address_list は成功しているので、取得しているリスト
の中身自体は問題なさそうなので、接続できないときはスキップしてしまってよいのでは
ないかとおもいました。

以下実行結果です。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…E…

Finished tests in 10.225113s, 2.1516 tests/s, 7.2371 assertions/s.

  1. Error:
    test_udp_server(TestSocket):
    RuntimeError: no response from #<Addrinfo:
    fd5e:b7ac:aaf8:9f02:223:32ff:feb4:f300>
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:297:in block (3 levels) in test_udp_server' /Users/ayumin/github/ruby/.ext/common/socket.rb:45:in connect_internal’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:92:in connect' /Users/ayumin/github/ruby/test/socket/test_socket.rb:293:in block (2
    levels) in test_udp_server’
    /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in each' /Users/ayumin/github/ruby/test/socket/test_socket.rb:292:in block in
    test_udp_server’
    /Users/ayumin/github/ruby/.ext/common/socket.rb:553:in
    udp_server_sockets' /Users/ayumin/github/ruby/test/socket/test_socket.rb:276:in test_udp_server’

22 tests, 74 assertions, 0 failures, 1 errors, 0 skips
make: *** [yes-test-all] Error 1

スキップするパッチは test_socket.rb.diff · GitHub です。

パッチ適用後の実行結果は以下のとおりです。

$ make test-all TESTS=‘test/socket/test_socket.rb’
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
– --disable-gems “./test/runner.rb” --ruby=“./miniruby -I./lib -I.
-I.ext/common ./tool/runruby.rb --extout=.ext – --disable-gems”
test/socket/test_socket.rb
Run options: “–ruby=./miniruby -I./lib -I. -I.ext/common
./tool/runruby.rb --extout=.ext – --disable-gems”

Running tests:

…S…

Finished tests in 20.225713s, 1.0877 tests/s, 3.6587 assertions/s.

  1. Skipped:
    test_udp_server(TestSocket)
    [/Users/ayumin/github/ruby/test/socket/test_socket.rb:307]:
    need sendmsg and recvmsg

22 tests, 74 assertions, 0 failures, 0 errors, 1 skips

=end