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

ruby-changes:66895

From: Nobuyoshi <ko1@a...>
Date: Tue, 27 Jul 2021 12:30:28 +0900 (JST)
Subject: [ruby-changes:66895] 2d0a1e5f61 (master): Try GC more during suppressing the warning

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

From 2d0a1e5f610be3230e0f5e4ab9650fef610fd342 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 27 Jul 2021 12:30:06 +0900
Subject: Try GC more during suppressing the warning

---
 test/ruby/test_gc.rb | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 02f86a2..609eda4 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -462,7 +462,12 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L462
       end
     end
     gen[100]
-    EnvUtil.suppress_warning {GC.start}
+    EnvUtil.suppress_warning do
+      1000.times do
+        break if result.size >= 2
+        GC.start
+      end
+    end
     skip "finalizers did not get run" if result.empty?
     assert_equal([:c1, :c2], result)
   end
@@ -488,7 +493,12 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L493
       end
     end
     gen[100]
-    EnvUtil.suppress_warning {GC.start}
+    EnvUtil.suppress_warning do
+      1000.times do
+        break if @result.size >= 2
+        GC.start
+      end
+    end
     skip "finalizers did not get run" if @result.empty?
     assert_equal([:c1, :c2], @result)
   end
-- 
cgit v1.1


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

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