diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-09-01 15:28:29 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-09-01 15:28:29 -0400 |
commit | 95def300d2202586dafea6cea8ebcc915f116b7a (patch) | |
tree | e8841835975662ee6298174f1620c9df622cd877 /test | |
parent | e8b646fe91abd48b68a470d71e3f7dbff6788cf0 (diff) | |
download | ruby-95def300d2202586dafea6cea8ebcc915f116b7a.tar.gz |
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>.
```
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 095ab27f5d..72cbb8072a 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -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 |