diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-10-25 16:44:15 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-10-25 16:44:15 +0900 |
commit | f3f1d89d469e3cc18f868a17fc0362c34318cedc (patch) | |
tree | 49823a27c0bada2277609fd540e68770678f9725 | |
parent | 356e203a3acd4d3d20ba12f956fd22e17b6363e9 (diff) | |
download | ruby-f3f1d89d469e3cc18f868a17fc0362c34318cedc.tar.gz |
skip tests that do not work on GC.stress
These tests rely on GC.stat and GC.last_gc_info, which are not
stable when GC.stress is true. Skip them for that case.
-rw-r--r-- | test/ruby/test_gc.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index c63ef51bd3..1511ea3011 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -54,6 +54,7 @@ class TestGc < Test::Unit::TestCase def test_start_full_mark return unless use_rgengc? + skip 'stress' if GC.stress GC.start(full_mark: false) assert_nil GC.latest_gc_info(:major_by) @@ -63,6 +64,8 @@ class TestGc < Test::Unit::TestCase end def test_start_immediate_sweep + skip 'stress' if GC.stress + GC.start(immediate_sweep: false) assert_equal false, GC.latest_gc_info(:immediate_sweep) @@ -106,12 +109,16 @@ class TestGc < Test::Unit::TestCase end def test_stat_single + skip 'stress' if GC.stress + stat = GC.stat assert_equal stat[:count], GC.stat(:count) assert_raise(ArgumentError){ GC.stat(:invalid) } end def test_stat_constraints + skip 'stress' if GC.stress + stat = GC.stat assert_equal stat[:total_allocated_pages], stat[:heap_allocated_pages] + stat[:total_freed_pages] assert_operator stat[:heap_sorted_length], :>=, stat[:heap_eden_pages] + stat[:heap_allocatable_pages], "stat is: " + stat.inspect @@ -125,6 +132,8 @@ class TestGc < Test::Unit::TestCase end def test_latest_gc_info + skip 'stress' if GC.stress + assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'eom' GC.start count = GC.stat(:heap_free_slots) + GC.stat(:heap_allocatable_pages) * GC::INTERNAL_CONSTANTS[:HEAP_PAGE_OBJ_LIMIT] |