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.
This commit is contained in:
Peter Zhu 2022-08-17 09:38:11 -04:00
parent ddb81b9307
commit b4daf6e28e
Notes: git 2022-08-17 23:54:50 +09:00

View File

@ -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