From 22bea37cfc739139ed53a6da06d52249e7b12961 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 2 Jun 2023 10:18:37 +0200 Subject: [PATCH] Stabilize test_latest_gc_info_need_major_by Fix: ``` 1) Failure: TestGc#test_latest_gc_info_need_major_by [/home/runner/work/ruby/ruby/src/test/ruby/test_gc.rb:266]: expected to not be nil. ``` `GC.stat(:major_gc_count)` can be bumped while `GC.latest_gc_info(:need_major_by)` is still nil. --- test/ruby/test_gc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 7e160817c8..2a7c1b507f 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -259,7 +259,7 @@ class TestGc < Test::Unit::TestCase # allocate objects until need_major_by is set or major GC happens major_count = GC.stat(:major_gc_count) objects = [] - while GC.stat(:major_gc_count) == major_count && GC.latest_gc_info(:need_major_by).nil? + while GC.latest_gc_info(:need_major_by).nil? objects.append(100.times.map { '*' }) end