summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-30 05:55:09 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-30 05:55:09 +0000
commit3077816cc1329d231d864a29e639fe64687b4b31 (patch)
treeedf38f54ad12924be2e940b17ba4234050af4e3f /test/ruby
parenta4a29af24eef5ec4b31ea71f964d8bfa72e7fd4d (diff)
show parent process's signal mask from child process
Because this tests raises timeout on failure, and it doesn't reach assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_gc.rb21
1 files changed, 8 insertions, 13 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 1b8b2f3cbd..8b1cfee736 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -331,16 +331,6 @@ class TestGc < Test::Unit::TestCase
end;
end
- def get_signal_info
- if RUBY_PLATFORM.include?('solaris')
- "\n"+`/usr/bin/psig #{$$}`
- elsif File.exist?('/proc/self/status')
- "\n"+IO.read('/proc/self/status')
- else
- ''
- end
- end
-
def test_interrupt_in_finalizer
bug10595 = '[ruby-core:66825] [Bug #10595]'
src = <<-'end;'
@@ -350,8 +340,13 @@ class TestGc < Test::Unit::TestCase
sleep 0.1
Process.kill("INT", pid) rescue break
}
- $stderr.puts `/usr/bin/psig #{$$}` if RUBY_PLATFORM.include?('solaris')
- $stderr.puts IO.read('/proc/self/status') if File.exist?('/proc/self/status')
+ if RUBY_PLATFORM.include?('solaris')
+ $stderr.puts `/usr/bin/psig #{$$}`
+ $stderr.puts `/usr/bin/psig #{Process.ppid}`
+ elsif File.exist?('/proc/self/status')
+ $stderr.puts IO.read('/proc/self/status')
+ $stderr.puts IO.read("/proc/#{Process.ppid}/status")
+ end
end
f = proc {1000.times {}}
loop do
@@ -364,7 +359,7 @@ class TestGc < Test::Unit::TestCase
unless /mswin|mingw/ =~ RUBY_PLATFORM
assert_equal("INT", Signal.signame(status.termsig), bug10595)
end
- assert_match(/Interrupt/, err.first, proc {err.join("\n")+get_signal_info})
+ assert_match(/Interrupt/, err.first, proc {err.join("\n")})
assert_empty(out)
end