ruby-changes:50476
From: ko1 <ko1@a...>
Date: Wed, 28 Feb 2018 16:31:55 +0900 (JST)
Subject: [ruby-changes:50476] ko1:r62608 (trunk): skip a test if another Thread is running.
ko1 2018-02-28 16:31:49 +0900 (Wed, 28 Feb 2018) New Revision: 62608 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62608 Log: skip a test if another Thread is running. * test/ruby/test_time.rb (test_strftime_no_hidden_garbage): this test checks no object allocation while specific process, however another thread can generate objects. Modified files: trunk/test/ruby/test_time.rb Index: test/ruby/test_time.rb =================================================================== --- test/ruby/test_time.rb (revision 62607) +++ test/ruby/test_time.rb (revision 62608) @@ -1104,6 +1104,8 @@ class TestTime < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_time.rb#L1104 end def test_strftime_no_hidden_garbage + skip unless Thread.list.size == 1 + fmt = %w(Y m d).map { |x| "%#{x}" }.join('-') # defeats optimization t = Time.at(0).getutc ObjectSpace.count_objects(res = {}) # creates strings on first call -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/