mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Suffixed memory leak tests as "memory_leak"
So that `TEST_EXCLUDES` option in common.mk works.
This commit is contained in:
parent
01e0e4c473
commit
ce00fda925
3 changed files with 8 additions and 6 deletions
|
@ -440,8 +440,9 @@ p Foo::Bar
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_no_leak
|
def test_no_memory_leak
|
||||||
assert_no_memory_leak([], '', <<~'end;', 'many autoloads', timeout: 60)
|
assert_no_memory_leak([], '', "#{<<~"begin;"}\n#{<<~'end;'}", 'many autoloads', timeout: 60)
|
||||||
|
begin;
|
||||||
200000.times do |i|
|
200000.times do |i|
|
||||||
m = Module.new
|
m = Module.new
|
||||||
m.instance_eval do
|
m.instance_eval do
|
||||||
|
|
|
@ -3913,21 +3913,22 @@ __END__
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_select_leak
|
def test_select_memory_leak
|
||||||
# avoid malloc arena explosion from glibc and jemalloc:
|
# avoid malloc arena explosion from glibc and jemalloc:
|
||||||
env = {
|
env = {
|
||||||
'MALLOC_ARENA_MAX' => '1',
|
'MALLOC_ARENA_MAX' => '1',
|
||||||
'MALLOC_ARENA_TEST' => '1',
|
'MALLOC_ARENA_TEST' => '1',
|
||||||
'MALLOC_CONF' => 'narenas:1',
|
'MALLOC_CONF' => 'narenas:1',
|
||||||
}
|
}
|
||||||
assert_no_memory_leak([env], <<-"end;", <<-"end;", rss: true, timeout: 60)
|
assert_no_memory_leak([env], "#{<<~"begin;"}\n#{<<~'else;'}", "#{<<~'end;'}", rss: true, timeout: 60)
|
||||||
|
begin;
|
||||||
r, w = IO.pipe
|
r, w = IO.pipe
|
||||||
rset = [r]
|
rset = [r]
|
||||||
wset = [w]
|
wset = [w]
|
||||||
exc = StandardError.new(-"select used to leak on exception")
|
exc = StandardError.new(-"select used to leak on exception")
|
||||||
exc.set_backtrace([])
|
exc.set_backtrace([])
|
||||||
Thread.new { IO.select(rset, wset, nil, 0) }.join
|
Thread.new { IO.select(rset, wset, nil, 0) }.join
|
||||||
end;
|
else;
|
||||||
th = Thread.new do
|
th = Thread.new do
|
||||||
Thread.handle_interrupt(StandardError => :on_blocking) do
|
Thread.handle_interrupt(StandardError => :on_blocking) do
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -523,7 +523,7 @@ class TestSymbol < Test::Unit::TestCase
|
||||||
assert_nothing_raised(NoMethodError, bug10259) {obj.send("unagi=".intern, 1)}
|
assert_nothing_raised(NoMethodError, bug10259) {obj.send("unagi=".intern, 1)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_symbol_fstr_leak
|
def test_symbol_fstr_memory_leak
|
||||||
bug10686 = '[ruby-core:67268] [Bug #10686]'
|
bug10686 = '[ruby-core:67268] [Bug #10686]'
|
||||||
assert_no_memory_leak([], "#{<<~"begin;"}\n#{<<~'else;'}", "#{<<~'end;'}", bug10686, limit: 1.71, rss: true, timeout: 20)
|
assert_no_memory_leak([], "#{<<~"begin;"}\n#{<<~'else;'}", "#{<<~'end;'}", bug10686, limit: 1.71, rss: true, timeout: 20)
|
||||||
begin;
|
begin;
|
||||||
|
|
Loading…
Add table
Reference in a new issue