ruby-changes:40304
From: naruse <ko1@a...>
Date: Fri, 30 Oct 2015 14:30:34 +0900 (JST)
Subject: [ruby-changes:40304] naruse:r52385 (trunk): Old linux's default hard rlimit_nofile is 1024
naruse 2015-10-30 14:30:21 +0900 (Fri, 30 Oct 2015) New Revision: 52385 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52385 Log: Old linux's default hard rlimit_nofile is 1024 Modified files: trunk/test/ruby/test_io.rb Index: test/ruby/test_io.rb =================================================================== --- test/ruby/test_io.rb (revision 52384) +++ test/ruby/test_io.rb (revision 52385) @@ -3067,13 +3067,20 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3067 # Unfortunately, ruby doesn't export FD_SETSIZE. then we assume it's 1024. fd_setsize = 1024 + # try to raise RLIM_NOFILE to >FD_SETSIZE + begin + Process.setrlimit(Process::RLIMIT_NOFILE, fd_setsize+10) + rescue Errno::EPERM + exit 0 + end + tempfiles = [] (0..fd_setsize+1).map {|i| tempfiles << Tempfile.open("test_io_select_with_many_files") } IO.select(tempfiles) - }, bug8080, timeout: 30, rlimit_nofile: 1024+10 + }, bug8080, timeout: 30 end if defined?(Process::RLIMIT_NOFILE) def test_read_32bit_boundary -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/