diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index de1dcd0bd6..4df883fb53 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1,6 +1,7 @@ require 'test/unit' require 'tmpdir' require 'pathname' +require 'timeout' require_relative 'envutil' require 'rbconfig' @@ -1250,4 +1251,21 @@ class TestProcess < Test::Unit::TestCase exs << Errno::E2BIG if defined?(Errno::E2BIG) assert_raise(*exs, bug4315) {Process.spawn('"a"|'*10_000_000)} end + + def test_system_sigpipe + return if /mswin|mingw/ =~ RUBY_PLATFORM + + pid = 0 + + with_tmpchdir do + assert_nothing_raised('[ruby-dev:12261]') do + timeout(3) do + pid = spawn('yes | ls') + Process.waitpid pid + end + end + end + ensure + Process.kill(:KILL, pid) if (pid != 0) rescue false + end end |