diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-16 05:07:28 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-16 05:07:28 +0000 |
commit | 92b367e0696785540143707af4093108d6d98c79 (patch) | |
tree | 5826af76d972b089711a751411a8589e2b41e820 /test/ruby | |
parent | c824d47ebc829560d022df74d355f69c601ea102 (diff) | |
download | ruby-92b367e0696785540143707af4093108d6d98c79.tar.gz |
* thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.
[Bug #8080] [ruby-core:53349]
* test/ruby/test_io.rb (TestIO#test_io_select_with_many_files):
test for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 451f6c246d..c19b1608df 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2629,5 +2629,30 @@ End s.puts(c.new) assert_equal("[...]\n", s.string, bug5986) end -end + def test_io_select_with_many_files + bug8080 = '[ruby-core:53349]' + + assert_normal_exit %q{ + require "tempfile" + + # try to raise RLIM_NOFILE to >FD_SETSIZE + # Unfortunately, ruby export FD_SETSIZE. then we assume it's 1024. + fd_setsize = 1024 + + begin + Process.setrlimit(Process::RLIMIT_NOFILE, fd_setsize+10) + rescue =>e + # Process::RLIMIT_NOFILE couldn't be raised. skip the test + exit 0 + end + + tempfiles = [] + (0..fd_setsize+1).map {|i| + tempfiles << Tempfile.open("test_io_select_with_many_files") + } + + IO.select(tempfiles) + }, bug8080 + end +end |