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

ruby-changes:50599

From: nobu <ko1@a...>
Date: Wed, 14 Mar 2018 20:55:15 +0900 (JST)
Subject: [ruby-changes:50599] nobu:r62748 (trunk): test_weakmap.rb: fixing CI failures

nobu	2018-03-14 20:55:07 +0900 (Wed, 14 Mar 2018)

  New Revision: 62748

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62748

  Log:
    test_weakmap.rb: fixing CI failures
    
    * test/ruby/test_weakmap.rb (test_include?): create and release
      the object to be garbage-collected in deeper frame.

  Modified files:
    trunk/test/ruby/test_weakmap.rb
Index: test/ruby/test_weakmap.rb
===================================================================
--- test/ruby/test_weakmap.rb	(revision 62747)
+++ test/ruby/test_weakmap.rb	(revision 62748)
@@ -28,9 +28,10 @@ class TestWeakMap < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_weakmap.rb#L28
     assert_raise(ArgumentError) {@wm[x] = :foo}
   end
 
-  def test_include?
-    m = __callee__[/test_(.*)/, 1]
-    k = "foo"
+  def assert_weak_include(m, k, n = 100)
+    if n > 0
+      return assert_weak_include(m, k, n-1)
+    end
     1.times do
       x = Object.new
       @wm[k] = x
@@ -38,6 +39,14 @@ class TestWeakMap < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_weakmap.rb#L39
       assert_not_send([@wm, m, "FOO".downcase])
       x = nil
     end
+  end
+
+  def test_include?
+    m = __callee__[/test_(.*)/, 1]
+    k = "foo"
+    1.times do
+      assert_weak_include(m, k)
+    end
     GC.start
     # skip('TODO: failure introduced from r60440')
     assert_not_send([@wm, m, k])

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

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