summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-13 23:46:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-13 23:46:54 +0000
commit7c8164395336a0bb270bb611ca77c2f68e97e50d (patch)
tree12199596a95d0dd3f754ac4f67e5679c770ed98f /test
parente50746da001ec16cbed6a6c842f43cf0f4de9364 (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_gc.rb28
1 files changed, 10 insertions, 18 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index f159421dac..32b05a89f7 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -334,29 +334,21 @@ class TestGc < Test::Unit::TestCase
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