1
0
Fork 0
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:
Nobuyoshi Nakada 2020-05-07 02:53:39 +09:00
parent 01e0e4c473
commit ce00fda925
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
3 changed files with 8 additions and 6 deletions

View file

@ -440,8 +440,9 @@ p Foo::Bar
end
end
def test_no_leak
assert_no_memory_leak([], '', <<~'end;', 'many autoloads', timeout: 60)
def test_no_memory_leak
assert_no_memory_leak([], '', "#{<<~"begin;"}\n#{<<~'end;'}", 'many autoloads', timeout: 60)
begin;
200000.times do |i|
m = Module.new
m.instance_eval do

View file

@ -3913,21 +3913,22 @@ __END__
end
end
def test_select_leak
def test_select_memory_leak
# avoid malloc arena explosion from glibc and jemalloc:
env = {
'MALLOC_ARENA_MAX' => '1',
'MALLOC_ARENA_TEST' => '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
rset = [r]
wset = [w]
exc = StandardError.new(-"select used to leak on exception")
exc.set_backtrace([])
Thread.new { IO.select(rset, wset, nil, 0) }.join
end;
else;
th = Thread.new do
Thread.handle_interrupt(StandardError => :on_blocking) do
begin

View file

@ -523,7 +523,7 @@ class TestSymbol < Test::Unit::TestCase
assert_nothing_raised(NoMethodError, bug10259) {obj.send("unagi=".intern, 1)}
end
def test_symbol_fstr_leak
def test_symbol_fstr_memory_leak
bug10686 = '[ruby-core:67268] [Bug #10686]'
assert_no_memory_leak([], "#{<<~"begin;"}\n#{<<~'else;'}", "#{<<~'end;'}", bug10686, limit: 1.71, rss: true, timeout: 20)
begin;