Project

General

Profile

Actions

Bug #5151

closed

test/socket/test_socket.rb fail when udp connection failed

Added by ayumin (Ayumu AIZAWA) over 13 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
- (darwin)
Backport:
[ruby-dev:44329]

Description

=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

スキップするパッチは https://gist.github.com/1121247 です。

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

$ 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


Files

test_socket.rb.diff (682 Bytes) test_socket.rb.diff ayumin (Ayumu AIZAWA), 08/03/2011 06:23 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #6692: TestSocket::test_udp_server always fails on OS X with Back to my Mac enabledCloseddrbrain (Eric Hodel)07/04/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0