diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-08-17 09:38:11 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-08-17 10:54:28 -0400 |
commit | b4daf6e28e4e0291e8c4c90d4ec7c0a00f715965 (patch) | |
tree | 19223c5eebfc474cdd383fc6b52ce40464f12f6d /test | |
parent | ddb81b9307f7114fcb37f6fcc37b7692b1a40cb4 (diff) | |
download | ruby-b4daf6e28e4e0291e8c4c90d4ec7c0a00f715965.tar.gz |
Fix flaky test for GC thrashing
GC could be in an intermediate state after creating the objects, so we
should finish GC by running a minor GC.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index a1e782daa9..d2f1e21e33 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -413,6 +413,10 @@ class TestGc < Test::Unit::TestCase 1_000_000.times { Object.new } + # Previous loop may have caused GC to be in an intermediate state, + # running a minor GC here will guarantee that GC will be complete + GC.start(full_mark: false) + after_stats = GC.stat # Should not be thrashing in page creation |