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.
20210408
T213303Z.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:
parent
6496c76d2a
commit
582f4bc188
1 changed files with 13 additions and 11 deletions
|
@ -133,6 +133,9 @@ class TestGCCompact < Test::Unit::TestCase
|
||||||
assert_equal hash, list_of_objects.hash
|
assert_equal hash, list_of_objects.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_ast_compacts
|
||||||
|
assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
|
||||||
|
begin;
|
||||||
def walk_ast ast
|
def walk_ast ast
|
||||||
children = ast.children.grep(RubyVM::AbstractSyntaxTree::Node)
|
children = ast.children.grep(RubyVM::AbstractSyntaxTree::Node)
|
||||||
children.each do |child|
|
children.each do |child|
|
||||||
|
@ -140,11 +143,10 @@ class TestGCCompact < Test::Unit::TestCase
|
||||||
walk_ast child
|
walk_ast child
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
ast = RubyVM::AbstractSyntaxTree.parse_file #{__FILE__.dump}
|
||||||
def test_ast_compacts
|
|
||||||
ast = RubyVM::AbstractSyntaxTree.parse_file __FILE__
|
|
||||||
assert GC.compact
|
assert GC.compact
|
||||||
walk_ast ast
|
walk_ast ast
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_compact_count
|
def test_compact_count
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue