summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-12-29 22:14:38 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-12-29 22:14:38 -0500
commit8e32c0174210cb5c843ebf820d17a9ec63b767fb (patch)
tree939743da8ca05f3ea136c80dff1fe0fdeb20a01c /test/ruby/test_process.rb
parent606c01727aa9e54db8cc1219de3fd7ba717efe54 (diff)
Change test_warmup_frees_pages to check each size pool
This should help in debugging the intermittent test failures on CI: TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2779]: <201> expected but was <202>.
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 0416b20176..188ef75fae 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -2771,12 +2771,14 @@ EOS
# Disable GC so we can make sure GC only runs in Process.warmup
GC.disable
- total_pages_before = GC.stat(:heap_eden_pages) + GC.stat(:heap_allocatable_pages)
+ total_pages_before = GC.stat_heap.map { |_, v| v[:heap_eden_pages] + v[:heap_allocatable_pages] }
Process.warmup
# Number of pages freed should cause equal increase in number of allocatable pages.
- assert_equal(total_pages_before, GC.stat(:heap_eden_pages) + GC.stat(:heap_allocatable_pages))
+ total_pages_before.each_with_index do |val, i|
+ assert_equal(val, GC.stat_heap(i, :heap_eden_pages) + GC.stat_heap(i, :heap_allocatable_pages), "size pool: #{i}")
+ end
assert_equal(0, GC.stat(:heap_tomb_pages))
assert_operator(GC.stat(:total_freed_pages), :>, 0)
end;