From f3f1d89d469e3cc18f868a17fc0362c34318cedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Fri, 25 Oct 2019 16:44:15 +0900 Subject: 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. --- test/ruby/test_gc.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') 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] -- cgit v1.2.3