1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_gc_compact.rb: Use assert_separately for debugging

... the following timeout failure.

http://rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20210408T213303Z.fail.html.gz
```
[ 8871/21204] TestGCCompact#test_ast_compactstimeout: output interval exceeds 600.0 seconds.
timeout: the process group 28416 is alive.
PSOUT  PGID   PID     ELAPSED %CPU    VSZ COMMAND         COMMAND
PSOUT 28416 28416       12:46  0.0 108120 gmake           gmake TESTS=--hide-skip -v RUBYOPT=-w test-all
PSOUT 28416 28423       12:46 88.2 1446124 ruby           ./test/runner.rb: TestGCCompact#test_ast_compacts
timeout: INT signal sent.
timeout: INT signal sent.
timeout: TERM signal sent.
timeout: TERM signal sent.
timeout: KILL signal sent.
```

This error repeatedly occurs on RHEL s390x.

This change sends SEGV when timeout occurs so that it should dump the backtrace.
This commit is contained in:
Yusuke Endoh 2021-04-09 13:59:46 +09:00
parent 6496c76d2a
commit 582f4bc188

View file

@ -133,18 +133,20 @@ class TestGCCompact < Test::Unit::TestCase
assert_equal hash, list_of_objects.hash
end
def walk_ast ast
children = ast.children.grep(RubyVM::AbstractSyntaxTree::Node)
children.each do |child|
assert child.type
walk_ast child
end
end
def test_ast_compacts
ast = RubyVM::AbstractSyntaxTree.parse_file __FILE__
assert GC.compact
walk_ast ast
assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
begin;
def walk_ast ast
children = ast.children.grep(RubyVM::AbstractSyntaxTree::Node)
children.each do |child|
assert child.type
walk_ast child
end
end
ast = RubyVM::AbstractSyntaxTree.parse_file #{__FILE__.dump}
assert GC.compact
walk_ast ast
end;
end
def test_compact_count