From b8b2d02b56e29466a0437b4bb8e8e0608a933f89 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 10 May 2011 12:36:59 -0700 Subject: test_io_splice: disable timeout-related tests in non-MRI timeout doesn't seem to interrupt C extensions reliably in some cases... --- test/test_io_splice.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test_io_splice.rb b/test/test_io_splice.rb index 6943bf9..26f2e00 100644 --- a/test/test_io_splice.rb +++ b/test/test_io_splice.rb @@ -9,6 +9,10 @@ require 'io/splice' class Test_IO_Splice < Test::Unit::TestCase + def self.mri? + (defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby") || !defined?(RUBY_ENGINE) + end + def test_splice str = 'abcde' size = 5 @@ -415,7 +419,7 @@ class Test_IO_Splice < Test::Unit::TestCase assert_equal 0, nr rs.close server.close - end + end if mri? def test_copy_stream_nonblock_dst server = TCPServer.new('127.0.0.1', 0) @@ -440,7 +444,7 @@ class Test_IO_Splice < Test::Unit::TestCase assert_equal nr, client.read(nr).size rs.close server.close - end + end if mri? def test_copy_stream_eof r, w = IO.pipe @@ -466,5 +470,4 @@ class Test_IO_Splice < Test::Unit::TestCase assert_nothing_raised { r.pipe_size = pipe_max_size } assert_raises(Errno::EPERM) { r.pipe_size = pipe_max_size * 2 } end if IO.method_defined?(:pipe_size) - end -- cgit v1.2.3-24-ge0c7