summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-04 14:24:21 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-04 14:24:21 +0000
commit315390097355992c6c671c8b956fa6951ef36569 (patch)
treee0577cb3e7defa2c13bf7366252e40bc22c7eb47 /test
parent7b2a41d317d12abcb25a1d5e710b36b419859e9d (diff)
merge revision(s) 50887,50896,50902: [Backport #11060]
* file.c (rb_file_load_ok): try opening file without gvl not to lock entire process. [Bug #11060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 3b7f6a7977..33aea6082a 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -687,4 +687,18 @@ class TestRequire < Test::Unit::TestCase
INPUT
}
end
+
+ def test_loading_fifo_threading
+ Tempfile.create(%w'fifo .rb') {|f|
+ f.close
+ File.unlink(f.path)
+ File.mkfifo(f.path)
+ assert_separately(["-", f.path], <<-END, timeout: 3)
+ th = Thread.current
+ Thread.start {begin sleep(0.001) end until th.stop?; th.raise(IOError)}
+ assert_raise(IOError) {load(ARGV[0])}
+ END
+ }
+ rescue Errno::ENOENT
+ end unless /mswin|mingw/ =~ RUBY_PLATFORM
end