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:
parent
e5c418d991
commit
2eb5d1dea4
@ -214,14 +214,17 @@ EOT
|
|||||||
assert_equal 128, s.buffer_initial_length
|
assert_equal 128, s.buffer_initial_length
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require'timeout'
|
||||||
def test_gc
|
def test_gc
|
||||||
bignum_too_long_to_embed_as_string = 1234567890123456789012345
|
bignum_too_long_to_embed_as_string = 1234567890123456789012345
|
||||||
expect = bignum_too_long_to_embed_as_string.to_s
|
expect = bignum_too_long_to_embed_as_string.to_s
|
||||||
stress, GC.stress = GC.stress, true
|
stress, GC.stress = GC.stress, true
|
||||||
|
|
||||||
10.times do |i|
|
timeout(1) do
|
||||||
tmp = bignum_too_long_to_embed_as_string.to_json
|
10.times do |i|
|
||||||
assert_equal expect, tmp
|
tmp = bignum_too_long_to_embed_as_string.to_json
|
||||||
|
assert_equal expect, tmp
|
||||||
|
end
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
GC.stress = stress
|
GC.stress = stress
|
||||||
|
Loading…
x
Reference in New Issue
Block a user