From 393192160726d6b299ca1f66fad9414e4bf8109a Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 28 Dec 2022 15:46:16 +0900 Subject: [PATCH] add debug print for the failure http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-docker/4364584 ``` 1) Failure: TestObjSpace#test_dump_all [/tmp/ruby/src/trunk-gc-asserts/test/objspace/test_objspace.rb:599]: number of strings. <2> expected but was <3>. ``` --- test/objspace/test_objspace.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index f0f294c31a..32cd1eda24 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -580,7 +580,14 @@ class TestObjSpace < Test::Unit::TestCase # This test makes assertions on the assignment to `str`, so we look for # the second appearance of /TEST STRING/ in the output test_string_in_dump_all = output.grep(/TEST2/) - assert_equal(2, test_string_in_dump_all.size, "number of strings") + + begin + assert_equal(2, test_string_in_dump_all.size, "number of strings") + rescue Exception => e + STDERR.puts e.inspect + STDERR.puts test_string_in_dump_all + raise + end entry_hash = JSON.parse(test_string_in_dump_all[1])