summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-02-24 14:45:05 +1100
committerKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-02-28 14:41:03 +1100
commitfe0b704df5553bdd59e90650ffbbfac785a2e48a (patch)
tree2b9b59cb1280cb91aa83b08fb2b3987ce21d1f76 /tool/lib
parent47b46fd98c71732400d53805f63ab988b28fa651 (diff)
Skip assert_no_memory_leak when ASAN is enabled
ASAN greatly increases the memory footprint of Ruby, so these static thresholds are not appropriate. There's no real need to run these tests under ASAN. [Bug #20274]
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/core_assertions.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index 358e7d9551..b456a55b34 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -74,6 +74,11 @@ module Test
module CoreAssertions
require_relative 'envutil'
require 'pp'
+ begin
+ require '-test-/asan'
+ rescue LoadError
+ end
+
nil.pretty_inspect
def mu_pp(obj) #:nodoc:
@@ -152,6 +157,9 @@ module Test
pend 'assert_no_memory_leak may consider RJIT memory usage as leak' if defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?
# For previous versions which implemented MJIT
pend 'assert_no_memory_leak may consider MJIT memory usage as leak' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
+ # ASAN has the same problem - its shadow memory greatly increases memory usage
+ # (plus asan has better ways to detect memory leaks than this assertion)
+ pend 'assert_no_memory_leak may consider ASAN memory usage as leak' if defined?(Test::ASAN) && Test::ASAN.enabled?
require_relative 'memory_status'
raise Test::Unit::PendedError, "unsupported platform" unless defined?(Memory::Status)