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:
parent
d8e90f5558
commit
f5ea054810
1 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue