Fix flaky test for Process.warmup

The test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_run_major_gc_and_compact [test/ruby/test_process.rb:2712]:
<2> expected but was
<3>.
```
This commit is contained in:
Peter Zhu 2023-09-01 15:28:29 -04:00
parent e8b646fe91
commit 95def300d2

View File

@ -2706,6 +2706,9 @@ EOS
def test_warmup_run_major_gc_and_compact
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
# Run a GC to ensure that we are not in the middle of a GC run
GC.start
major_gc_count = GC.stat(:major_gc_count)
compact_count = GC.stat(:compact_count)
Process.warmup