diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-21 02:38:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-21 02:38:04 +0000 |
commit | 0ce605225fff11cb30e679958f39dfe1e7f4b1dd (patch) | |
tree | 4045aa3322228154574e2a6daa5fb1a784595fff | |
parent | 81e687d285b004bec3c7fc87a7c72d9bab03ddf3 (diff) | |
download | ruby-0ce605225fff11cb30e679958f39dfe1e7f4b1dd.tar.gz |
test_require.rb: reduce GC
* test/ruby/test_require.rb (test_loading_fifo_fd_leak): invoke GC
only when FDs exhausted to reduce the test time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_require.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 5c2221c77b..2e33499b41 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -769,9 +769,13 @@ class TestRequire < Test::Unit::TestCase 100.times do |i| Thread.start {begin sleep(0.001) end until th.stop?; th.raise(IOError)} assert_raise(IOError, "\#{i} time") do - tap {tap {tap {load(ARGV[0])}}} + begin + tap {tap {tap {load(ARGV[0])}}} + rescue LoadError + GC.start + retry + end end - GC.start end end; } |