[前][次][番号順一覧][スレッド一覧]

ruby-changes:58436

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 25 Oct 2019 16:47:57 +0900 (JST)
Subject: [ruby-changes:58436] f3f1d89d46 (master): skip tests that do not work on GC.stress

https://git.ruby-lang.org/ruby.git/commit/?id=f3f1d89d46

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?=
 <shyouhei@r...>
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.

diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index c63ef51..1511ea3 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -54,6 +54,7 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L54
 
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L64
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L109
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L132
   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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]