From b05721765ef08c56443221808f611b571f0de767 Mon Sep 17 00:00:00 2001 From: tmm1 Date: Sat, 30 Nov 2013 21:02:00 +0000 Subject: [PATCH] * test/ruby/test_gc.rb (test_gc_reason): Force minor GC by consuming free slots to fix test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/ruby/test_gc.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 343684cd39..ed5261eefb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Dec 1 06:00:49 2013 Aman Gupta + + * test/ruby/test_gc.rb (test_gc_reason): Force minor GC by consuming + free slots to fix test. + Sat Nov 30 21:22:11 2013 Nobuyoshi Nakada * dir.c (dir_initialize): check unknown keywords. [ruby-dev:47152] diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 2668582ed8..034a330c85 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -80,7 +80,8 @@ class TestGc < Test::Unit::TestCase end def test_gc_reason - 100_000.times{ "a" + "b" } + GC.start + GC.stat[:heap_free_slot].times{ "a" + "b" } assert_equal({:gc_by => :newobj}, GC::Profiler.decode_flags(GC.stat[:last_collection_flags])) end