From c10da1db900299c3472c4bd8e6c9f92f4e75095f Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 18 Oct 2015 03:07:39 +0000 Subject: test_require.rb: no guarantees to load FIFO * test/ruby/test_require.rb (loading_fifo): loading from FIFO is not guaranteed, it just should not block the whole process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_require.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/ruby/test_require.rb') diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 4ccabf2d8c..b48de0e240 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -699,11 +699,12 @@ class TestRequire < Test::Unit::TestCase f.close File.unlink(f.path) File.mkfifo(f.path) - assert_separately(["-", f.path], <<-END, timeout: 3) + assert_ruby_status(["-", f.path], <<-END, timeout: 3) th = Thread.current Thread.start {begin sleep(0.001) end until th.stop?; th.raise(IOError)} - assert_raise(IOError) do + begin load(ARGV[0]) + rescue IOError end END } @@ -715,7 +716,7 @@ class TestRequire < Test::Unit::TestCase File.unlink(f.path) File.mkfifo(f.path) - assert_separately(["-", f.path], <<-INPUT, timeout: 3) + assert_ruby_status(["-", f.path], <<-INPUT, timeout: 3) path = ARGV[0] th = Thread.current Thread.start { @@ -723,12 +724,11 @@ class TestRequire < Test::Unit::TestCase sleep(0.001) end until th.stop? open(path, File::WRONLY | File::NONBLOCK) {|fifo_w| - fifo_w.puts "class C1; FOO='foo'; end" + fifo_w.print "__END__\n" # ensure finishing } } load(path) - assert_equal(C1::FOO, "foo") INPUT } end if defined?(File.mkfifo) -- cgit v1.2.3