1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

disable GC on a test

CI fails with GC while `foo{}`, so that disable GC for this script.
This commit is contained in:
Koichi Sasada 2020-06-09 15:52:25 +09:00
parent 366646c15e
commit 195075e8f5

View file

@ -701,11 +701,11 @@ class TestRubyOptimization < Test::Unit::TestCase
def test_block_parameter_should_not_create_objects
assert_separately [], <<-END
#
def foo &b
end
h1 = {}; h2 = {}
ObjectSpace.count_objects(h1) # rehearsal
GC.start; GC.disable # to disable GC while foo{}
ObjectSpace.count_objects(h1)
foo{}
ObjectSpace.count_objects(h2)