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

Add timeout to TC_JSONGenerate#test_gc.

http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20120409T230301Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-04-10 03:41:50 +00:00
parent e5c418d991
commit 2eb5d1dea4

View file

@ -214,14 +214,17 @@ EOT
assert_equal 128, s.buffer_initial_length
end
require'timeout'
def test_gc
bignum_too_long_to_embed_as_string = 1234567890123456789012345
expect = bignum_too_long_to_embed_as_string.to_s
stress, GC.stress = GC.stress, true
10.times do |i|
tmp = bignum_too_long_to_embed_as_string.to_json
assert_equal expect, tmp
timeout(1) do
10.times do |i|
tmp = bignum_too_long_to_embed_as_string.to_json
assert_equal expect, tmp
end
end
ensure
GC.stress = stress