summaryrefslogtreecommitdiff
path: root/spec/ruby/core/sizedqueue
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-11-05 13:14:51 +1100
committerKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-11-06 09:58:47 -0500
commit96e695ad00b78cf7090eebdb4cfa9dd3350bd299 (patch)
treed4b8ef0d60d07ee64272c2959a0af5a15b222994 /spec/ruby/core/sizedqueue
parent261f5d3202683125651a12519c079ef9d5f303f4 (diff)
Fix flakiness in TestGc#test_thrashing_for_young_objects
I caught a reproduction of this test failing under rr, and was able to replay it to isolate the failure. The call to `before_stat_heap = GC.stat_heap` is itself allocating a hash, which in unlucky circumstances can result in a new page being allocated and thus `before_stats[:heap_allocated_pages]` no longer equals `after_stats[:heap_allocated_pages]`. The solution is to use the form of GC.stat/stat_heap which takes a hash as an argument, and thus needs to perform no Ruby allocations itself.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11997
Diffstat (limited to 'spec/ruby/core/sizedqueue')
0 files changed, 0 insertions, 0 deletions