summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-09 07:54:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-09 07:54:56 +0000
commit3e972a116fb063fc0c1dda7292ff386d6d2ae737 (patch)
tree26d2ae3af928fffffe477356cc02a725c2d0e7ec /test/ruby/test_process.rb
parentb3544b2551b8a0fd931e867c4126cdd9d79a4bba (diff)
test_process.rb: test for [Bug #11340]
* test/ruby/test_process.rb (test_wait_exception): test for r51202 and r51203. [Bug #11340] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 3c1b78fd54..02ba47fb35 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1369,6 +1369,29 @@ class TestProcess < Test::Unit::TestCase
end
end
+ def test_wait_exception
+ bug11340 = '[ruby-dev:49176] [Bug #11340]'
+ t0 = t1 = nil
+ IO.popen([RUBY, '-e', 'puts;STDOUT.flush;Thread.start{gets;exit};sleep(3)'], 'r+') do |f|
+ pid = f.pid
+ f.gets
+ t0 = Time.now
+ th = Thread.start(Thread.current) do |main|
+ Thread.pass until main.stop?
+ main.raise Interrupt
+ end
+ begin
+ assert_raise(Interrupt) {Process.wait(pid)}
+ ensure
+ th.kill.join
+ end
+ t1 = Time.now
+ f.puts
+ end
+ assert_operator(t1 - t0, :<, 3,
+ ->{"#{bug11340}: #{t1-t0} seconds to interrupt Process.wait"})
+ end
+
def test_abort
with_tmpchdir do
s = run_in_child("abort")