ruby-changes:36752
From: nobu <ko1@a...>
Date: Sun, 14 Dec 2014 08:47:10 +0900 (JST)
Subject: [ruby-changes:36752] nobu:r48833 (trunk): test_gc.rb: workaround for Windows
nobu 2014-12-14 08:46:54 +0900 (Sun, 14 Dec 2014) New Revision: 48833 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48833 Log: test_gc.rb: workaround for Windows * test/ruby/test_gc.rb (test_interrupt_in_finalizer): use inner process signal for Windows. [ruby-core:66825] [Bug #10595] Modified files: trunk/test/ruby/test_gc.rb Index: test/ruby/test_gc.rb =================================================================== --- test/ruby/test_gc.rb (revision 48832) +++ test/ruby/test_gc.rb (revision 48833) @@ -334,29 +334,21 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L334 def test_interrupt_in_finalizer bug10595 = '[ruby-core:66825] [Bug #10595]' src = <<-'end;' + pid = $$ + Thread.start do + 10.times { + sleep 0.1 + Process.kill("INT", pid) rescue break + } + sleep 5 + Process.kill("KILL", pid) rescue nil + end f = proc {1000.times {}} loop do ObjectSpace.define_finalizer(Object.new, f) end end; - error = nil - status = nil - EnvUtil.invoke_ruby(["-e", src], "", false, true) do |_, _, stderr, pid| - 10.times { - sleep 0.1 - Process.kill("INT", pid) rescue break - } - th = Thread.start do - sleep 5 - Process.kill("KILL", pid) rescue nil - end - error = stderr.read - _, status = Process.wait2(pid) - th.kill - end - assert_predicate status, :signaled? - assert_equal "INT", Signal.signame(status.termsig), bug10595 - assert_match /Interrupt/, error, bug10595 + assert_in_out_err(["-e", src], "", [], /Interrupt/, bug10595) end def test_verify_internal_consistency -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/