diff --git a/ChangeLog b/ChangeLog index 91c4fc672f..7093ce4ca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 6 23:36:07 2016 Shugo Maeda + + * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint): + send SIGKILL if the child process doesn't die within 1 second. + Sun Nov 6 21:54:28 2016 NARUSE, Yui * tool/vcs.rb (export_changelog): generate ChangeLog file from 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)