1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Moved NoMemoryError hook

Moved NoMemoryError hook from AutoRunner.run to Runner#run, so
it will work even in non-autorunning mode.
This commit is contained in:
Nobuyoshi Nakada 2019-07-25 14:29:15 +09:00
parent d8e90f5558
commit f5ea054810
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -1072,6 +1072,14 @@ module Test
include Test::Unit::TimeoutOption
include Test::Unit::RunCount
def run(argv)
super
rescue NoMemoryError
system("cat /proc/meminfo") if File.exist?("/proc/meminfo")
system("ps x -opid,args,%cpu,%mem,nlwp,rss,vsz,wchan,stat,start,time,etime,blocked,caught,ignored,pending,f") if File.exist?("/bin/ps")
raise
end
class << self; undef autorun; end
@@stop_auto_run = false
@ -1135,10 +1143,6 @@ module Test
abort @options.banner
end
@runner.run(@argv) || true
rescue NoMemoryError
system("cat /proc/meminfo") if File.exist?("/proc/meminfo")
system("ps x -opid,args,%cpu,%mem,nlwp,rss,vsz,wchan,stat,start,time,etime,blocked,caught,ignored,pending,f") if File.exist?("/bin/ps")
raise
end
def self.run(*args)