diff options
| author | KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au> | 2024-11-05 13:14:51 +1100 |
|---|---|---|
| committer | KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au> | 2024-11-06 09:58:47 -0500 |
| commit | 96e695ad00b78cf7090eebdb4cfa9dd3350bd299 (patch) | |
| tree | d4b8ef0d60d07ee64272c2959a0af5a15b222994 /spec/ruby | |
| parent | 261f5d3202683125651a12519c079ef9d5f303f4 (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')
0 files changed, 0 insertions, 0 deletions
