Skip to content

Commit

Permalink
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/truffle/memory/minimum-heap.rb
Original file line number Diff line number Diff line change
@@ -20,11 +20,18 @@
TOLERANCE = 1024
UPPER_FACTOR = 4

begin
`timeout --help`
TIMEOUT = 'timeout'
rescue
TIMEOUT = 'gtimeout'
end

def can_run(heap)
print "trying #{heap} KB... "

output = `#{COMMAND} -J-Xmx#{heap}k #{OPTIONS} 2>&1`
can_run = !output.include?('OutOfMemoryError')
output = `#{TIMEOUT} 120s #{COMMAND} -J-Xmx#{heap}k #{OPTIONS} 2>&1`
can_run = $?.exitstatus != 124 && !output.include?('OutOfMemoryError')

if can_run
puts "yes"

0 comments on commit 935c331

Please sign in to comment.