ruby-changes:44568
From: shugo <ko1@a...>
Date: Sun, 6 Nov 2016 23:41:44 +0900 (JST)
Subject: [ruby-changes:44568] shugo:r56641 (trunk): * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
shugo 2016-11-06 23:41:39 +0900 (Sun, 06 Nov 2016) New Revision: 56641 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56641 Log: * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint): send SIGKILL if the child process doesn't die within 1 second. Modified files: trunk/ChangeLog trunk/test/ruby/test_optimization.rb Index: test/ruby/test_optimization.rb =================================================================== --- test/ruby/test_optimization.rb (revision 56640) +++ test/ruby/test_optimization.rb (revision 56641) @@ -338,9 +338,21 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L338 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) Index: ChangeLog =================================================================== --- ChangeLog (revision 56640) +++ ChangeLog (revision 56641) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Nov 6 23:36:07 2016 Shugo Maeda <shugo@r...> + + * 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 <naruse@r...> * tool/vcs.rb (export_changelog): generate ChangeLog file from -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/