From d1f83c37f890e5345e68853c5e268975d4396ffc Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 1 Sep 2023 17:48:55 -0400 Subject: [PATCH] Try to fix flaky test for Process.warmup The test sometimes fails with: ``` 1) Failure: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2749]: <0> expected but was <1>. ``` I think there's a page with an object that needs finalization, so run GC to clear that object. --- test/ruby/test_process.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 72cbb8072a..9cef299b66 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2732,6 +2732,8 @@ EOS def test_warmup_frees_pages assert_separately([{"RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO" => "1.0"}, "-W0"], "#{<<~"begin;"}\n#{<<~'end;'}") begin; + GC.start + TIMES = 10_000 ary = Array.new(TIMES) TIMES.times do |i|