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.
This commit is contained in:
Peter Zhu 2023-09-01 17:48:55 -04:00
parent 95308988b6
commit d1f83c37f8

View File

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