This commit is contained in:
Nobuyoshi Nakada 2019-08-05 11:55:21 +09:00
Родитель 521e25baa4
Коммит dc0c04764f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4BC7D6DF58D8DF60
1 изменённых файлов: 9 добавлений и 11 удалений

Просмотреть файл

@ -246,18 +246,16 @@ class TestProcess < Test::Unit::TestCase
assert_raise(ArgumentError) do assert_raise(ArgumentError) do
system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123) system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123)
end end
assert_separately([],"#{<<-"begin;"}\n#{<<~'end;'}") assert_separately([],"#{<<~"begin;"}\n#{<<~'end;'}", 'rlimit_cpu'.to_sym => 3600)
BUG = "[ruby-core:82033] [Bug #13744]" BUG = "[ruby-core:82033] [Bug #13744]"
RUBY = "#{RUBY}"
begin; begin;
assert(system("#{RUBY}", "-e", assert_equal([3600,3600], Process.getrlimit(:CPU), BUG)
"exit([3600,3600] == Process.getrlimit(:CPU))",
'rlimit_cpu'.to_sym => 3600), BUG)
assert_raise(ArgumentError, BUG) do
system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123)
end
end; end;
assert_raise_with_message(ArgumentError, /bogus/) do
system(RUBY, '-e', 'exit', :rlimit_bogus => 123)
end
assert_raise_with_message(ArgumentError, /rlimit_cpu/) { assert_raise_with_message(ArgumentError, /rlimit_cpu/) {
system(RUBY, '-e', 'exit', "rlimit_cpu\0".to_sym => 3600) system(RUBY, '-e', 'exit', "rlimit_cpu\0".to_sym => 3600)
} }
@ -636,7 +634,7 @@ class TestProcess < Test::Unit::TestCase
rescue NotImplementedError rescue NotImplementedError
return return
end end
assert(FileTest.pipe?("fifo"), "should be pipe") assert_file.pipe?("fifo")
t1 = Thread.new { t1 = Thread.new {
system(*ECHO["output to fifo"], :out=>"fifo") system(*ECHO["output to fifo"], :out=>"fifo")
} }
@ -1635,7 +1633,7 @@ class TestProcess < Test::Unit::TestCase
w.puts w.puts
end end
Process.wait pid Process.wait pid
assert sig_r.wait_readable(5), 'self-pipe not readable' assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable'
end end
if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE. It may trigger extra SIGCHLD. if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE. It may trigger extra SIGCHLD.
assert_equal [true], signal_received.uniq, "[ruby-core:19744]" assert_equal [true], signal_received.uniq, "[ruby-core:19744]"
@ -2260,7 +2258,7 @@ EOS
th = Process.detach(pid) th = Process.detach(pid)
assert_equal pid, th.pid assert_equal pid, th.pid
status = th.value status = th.value
assert status.success?, status.inspect assert_predicate status, :success?
end if defined?(fork) end if defined?(fork)
def test_kill_at_spawn_failure def test_kill_at_spawn_failure