diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-10-18 11:01:43 +0200 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-10-18 11:01:43 +0200 |
commit | f546fe15d547472f60c4a2d2857321b3c5084f0f (patch) | |
tree | 261a1082ceda1263314520684f56e6c7d450235e /test | |
parent | ac8ece81f26f29dc2f9d77fcdb0620a51ba26f1e (diff) | |
download | ruby-f546fe15d547472f60c4a2d2857321b3c5084f0f.tar.gz |
Loosen assertion for flaky weak references test
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 567e7b5d80..b22f5b8a65 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -327,7 +327,8 @@ class TestGc < Test::Unit::TestCase # 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) |