mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_bigdecimal.rb: adjust
* test/bigdecimal/test_bigdecimal.rb (assert_no_memory_leak): fix GC scope and adjust limits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bdf07741f3
commit
19341b86be
1 changed files with 2 additions and 2 deletions
|
@ -1554,11 +1554,11 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def assert_no_memory_leak(code, *rest, **opt)
|
||||
code = "5.times {1_000.times {begin #{code}; rescue NoMemoryError; end; GC.start}} if b"
|
||||
code = "8.times {20_000.times {begin #{code}; rescue NoMemoryError; end}; GC.start}"
|
||||
super(["-rbigdecimal"],
|
||||
"b = BigDecimal('10'); b.nil?; " \
|
||||
"GC.add_stress_to_class(BigDecimal); "\
|
||||
"#{code}", code, *rest, rss: true, **opt)
|
||||
"#{code}", code, *rest, rss: true, limit: 1.1, **opt)
|
||||
end
|
||||
|
||||
if EnvUtil.gc_stress_to_class?
|
||||
|
|
Loading…
Reference in a new issue