diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 2895ca50bfd126..6b95e2a2e60038 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -261,9 +261,12 @@ def test_latest_gc_info_need_major_by 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