[前][次][番号順一覧][スレッド一覧]

ruby-changes:73934

From: Peter <ko1@a...>
Date: Sun, 9 Oct 2022 04:07:01 +0900 (JST)
Subject: [ruby-changes:73934] b22a2803a8 (master): Fix flaky test test_thrashing_for_young_objects

https://git.ruby-lang.org/ruby.git/commit/?id=b22a2803a8

From b22a2803a86d6adabc24dd00ef5ae90762a2ae46 Mon Sep 17 00:00:00 2001
From: Peter Zhu <peter@p...>
Date: Sat, 8 Oct 2022 15:04:18 -0400
Subject: Fix flaky test test_thrashing_for_young_objects

The test could be flaky when a heap has below GC_HEAP_INIT_SLOTS number
of free slots because it would trigger a major GC and allocate more
pages.
---
 test/ruby/test_gc.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 7b0c0b85ab..06bf038cae 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -406,6 +406,9 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L406
     # This test prevents bugs like [Bug #18929]
 
     assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'RUBY'
+      # Grow the heap
+      @ary = 100_000.times.map { Object.new }
+
       # Warmup to make sure heap stabilizes
       1_000_000.times { Object.new }
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]