summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2023-06-02 10:18:37 +0200
committerJean Boussier <jean.boussier@gmail.com>2023-06-02 16:11:45 +0200
commit22bea37cfc739139ed53a6da06d52249e7b12961 (patch)
tree69031ec3e07bbd18672500ff0957e2472bf7598f
parent83056817298d188937d157b54918e99b689fc12e (diff)
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]: <nil> expected to not be nil. ``` `GC.stat(:major_gc_count)` can be bumped while `GC.latest_gc_info(:need_major_by)` is still nil.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7895
-rw-r--r--test/ruby/test_gc.rb2
1 files changed, 1 insertions, 1 deletions
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