diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2021-04-09 13:59:46 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2021-04-09 13:59:46 +0900 |
commit | 582f4bc1889c3161f47a76b46b60d5b9c6fb0bde (patch) | |
tree | cc4f9ded90be611ea7748fd27ae4b1b56ed286f7 | |
parent | 6496c76d2a4cc3d6c4870454280d66dc399e11db (diff) |
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.
-rw-r--r-- | test/ruby/test_gc_compact.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index 4a8cff33f4..8dfa66a177 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -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 |