From 4542d61628acb2de05a319fe4f5da9b3450260e3 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 28 Feb 2018 07:31:49 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_time.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index faeff8ded3..d89a093303 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -1104,6 +1104,8 @@ class TestTime < Test::Unit::TestCase 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