diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-09-01 17:48:55 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-09-01 17:48:55 -0400 |
commit | d1f83c37f890e5345e68853c5e268975d4396ffc (patch) | |
tree | 9941c0d445a202405d25f2282c18eed95baaf361 | |
parent | 95308988b6f70c04c43015a78c93b3f876da5958 (diff) | |
download | ruby-d1f83c37f890e5345e68853c5e268975d4396ffc.tar.gz |
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.
-rw-r--r-- | test/ruby/test_process.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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| |