diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 0f4a13211e..7650c68eca 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -262,9 +262,12 @@ class TestGc < Test::Unit::TestCase objects.append(100.times.map { '*' }) end - assert_not_nil GC.latest_gc_info(:need_major_by) + need_major_by = GC.latest_gc_info(:need_major_by) GC.start(full_mark: false) # should be upgraded to major - assert_not_nil GC.latest_gc_info(:major_by) + major_by = GC.latest_gc_info(:major_by) + + assert_not_nil(need_major_by) + assert_not_nil(major_by) end def test_stress_compile_send