aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-07 02:53:39 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-07 02:53:39 +0900
commitce00fda9254887388b15a3a9ff505d3473cecf57 (patch)
tree0635a9aa79986a78a3f65420a8e41e096ae74810
parent01e0e4c4732b2019166a45b21fbf2b400554e403 (diff)
downloadruby-ce00fda9254887388b15a3a9ff505d3473cecf57.tar.gz
Suffixed memory leak tests as "memory_leak"
So that `TEST_EXCLUDES` option in common.mk works.
-rw-r--r--test/ruby/test_autoload.rb5
-rw-r--r--test/ruby/test_io.rb7
-rw-r--r--test/ruby/test_symbol.rb2
3 files changed, 8 insertions, 6 deletions
diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb
index d3470d59d4..2e2e79dffd 100644
--- a/test/ruby/test_autoload.rb
+++ b/test/ruby/test_autoload.rb
@@ -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
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 9dc0debe16..8c7fe69128 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -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
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index ff246f137a..f6ef70f3df 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -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;