aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 97b48827b7..1e7b63a47a 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1044,4 +1044,16 @@ class TestProcess < Test::Unit::TestCase
def test_pst_inspect
assert_nothing_raised { Process::Status.allocate.inspect }
end
+
+ def test_wait_and_sigchild
+ signal_received = []
+ Signal.trap(:CHLD) { signal_received << true; puts "child died" }
+ pid = fork { sleep 1; exit }
+ Thread.start { raise }
+ Process.wait pid
+ sleep 2
+ assert_equal [true], signal_received, " [ruby-core:19744]"
+ ensure
+ Signal.trap(:CHLD, 'DEFAULT')
+ end
end