summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-27 12:30:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-27 12:30:06 +0900
commit2d0a1e5f610be3230e0f5e4ab9650fef610fd342 (patch)
treefacf290674080a13cbd9685a9db0b70b0d6f9f0b /test
parented51e8b8fa9f7e811e69de30f7695dc2242e8e69 (diff)
Try GC more during suppressing the warning
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_gc.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 02f86a2463..609eda4939 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -462,7 +462,12 @@ class TestGc < Test::Unit::TestCase
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
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