fix conditions to setrlimit
* test/ruby/test_io.rb (test_dup_many): limit FD only if possible. * test/ruby/test_process.rb (assert_fail_too_long_path): fix the condition for platform specific feature git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1a98528cb7
commit
7d95b96e7b
@ -1137,8 +1137,10 @@ class TestIO < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_dup_many
|
def test_dup_many
|
||||||
ruby('-e', <<-'End') {|f|
|
ruby('-e', <<-'End') {|f|
|
||||||
|
if defined?(Process::RLIMIT_NOFILE)
|
||||||
lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
|
lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
|
||||||
Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min)
|
Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min)
|
||||||
|
end
|
||||||
ok = 0
|
ok = 0
|
||||||
a = []
|
a = []
|
||||||
begin
|
begin
|
||||||
|
@ -1597,7 +1597,7 @@ class TestProcess < Test::Unit::TestCase
|
|||||||
exs = [Errno::ENOENT]
|
exs = [Errno::ENOENT]
|
||||||
exs << Errno::E2BIG if defined?(Errno::E2BIG)
|
exs << Errno::E2BIG if defined?(Errno::E2BIG)
|
||||||
opts = {[STDOUT, STDERR]=>File::NULL}
|
opts = {[STDOUT, STDERR]=>File::NULL}
|
||||||
opts[:rlimit_nproc] = 128 if /mswin|mingw/ =~ RUBY_PLATFORM
|
opts[:rlimit_nproc] = 128 if defined?(Process::RLIMIT_NPROC)
|
||||||
EnvUtil.suppress_warning do
|
EnvUtil.suppress_warning do
|
||||||
assert_raise(*exs, mesg) do
|
assert_raise(*exs, mesg) do
|
||||||
begin
|
begin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user