ruby-changes:61028
From: Nobuyoshi <ko1@a...>
Date: Thu, 7 May 2020 05:23:05 +0900 (JST)
Subject: [ruby-changes:61028] ce00fda925 (master): Suffixed memory leak tests as "memory_leak"
https://git.ruby-lang.org/ruby.git/commit/?id=ce00fda925 From ce00fda9254887388b15a3a9ff505d3473cecf57 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 7 May 2020 02:53:39 +0900 Subject: Suffixed memory leak tests as "memory_leak" So that `TEST_EXCLUDES` option in common.mk works. diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb index d3470d5..2e2e79d 100644 --- a/test/ruby/test_autoload.rb +++ b/test/ruby/test_autoload.rb @@ -440,8 +440,9 @@ p Foo::Bar https://github.com/ruby/ruby/blob/trunk/test/ruby/test_autoload.rb#L440 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 9dc0deb..8c7fe69 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3913,21 +3913,22 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3913 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 ff246f1..f6ef70f 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -523,7 +523,7 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L523 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; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/