diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-18 03:07:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-18 03:07:39 +0000 |
commit | 61685c762e8a87a36336889bea6abc9da4137149 (patch) | |
tree | 75bc195a52d5c2e7a461114d5b464e331dc2aa27 | |
parent | 7cb20b8fb88ee839e046151fc8723f9595995b97 (diff) |
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
-rw-r--r-- | test/ruby/test_require.rb | 10 |
1 files changed, 5 insertions, 5 deletions
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) |