diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-06 14:41:39 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-06 14:41:39 +0000 |
commit | 90bf4a8edb295308d07584d94366998ad0a7e988 (patch) | |
tree | f0534ee065d8d12f61c4acf05390cdafecdfc8fa /test | |
parent | 76e047a8435c4a5d0b86a5dde34122be4b44c367 (diff) | |
download | ruby-90bf4a8edb295308d07584d94366998ad0a7e988.tar.gz |
* test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
send SIGKILL if the child process doesn't die within 1 second.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_optimization.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 6f5262a69d..0205c92e2f 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -338,9 +338,21 @@ EOS in_p.write(script) in_p.close out_p.gets - Process.kill(:SIGINT, pid) - *, stat = Process.wait2(pid) - [stat, err_p.read] + sig = :INT + begin + Process.kill(sig, pid) + Timeout.timeout(1) do + *, stat = Process.wait2(pid) + [stat, err_p.read] + end + rescue Timeout::Error + if sig == :INT + sig = :KILL + retry + else + raise + end + end } assert_equal("INT", Signal.signame(status.termsig)) assert_match(/Interrupt/, err, bug) |