Skip to content

Commit

Permalink
Loosen assertion for flaky weak references test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Oct 18, 2023
1 parent ac8ece8 commit f546fe1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/ruby/test_gc.rb
Expand Up @@ -327,7 +327,8 @@ def test_latest_gc_info_weak_references_count
# Run full GC again to collect stats about weak references
GC.start
assert_equal(0, wmap.size)
# Sometimes the WeakMap has one element, which might be held on by registers.
assert_operator(wmap.size, :<=, 1)
assert_operator(GC.latest_gc_info(:weak_references_count), :<=, before_weak_references_count - count + error_tolerance)
assert_operator(GC.latest_gc_info(:retained_weak_references_count), :<=, before_retained_weak_references_count - count + error_tolerance)
Expand Down

0 comments on commit f546fe1

Please sign in to comment.