Handle Array#* raising ArgumentError in test

Treat ArgumentError as NoMemoryError, so it will resize the array
and try again.

Fixes [Bug #12500]
This commit is contained in:
Jeremy Evans 2023-08-23 10:56:39 -07:00
parent ce79887da0
commit bd22bb259c
Notes: git 2023-08-23 23:46:39 +00:00

View File

@ -1799,7 +1799,11 @@ class TestProcess < Test::Unit::TestCase
loop do
Process.spawn(cmds.join(sep), opts)
min = [cmds.size, min].max
cmds *= 100
begin
cmds *= 100
rescue ArgumentError
raise NoMemoryError
end
end
rescue NoMemoryError
size = cmds.size