Fallback to spawn instead of fork in jruby (#36111)

* Fallback to spawn instead of fork in jruby

This commit: b342db6 introduced a `fork` fork when running the railties
tests since this is not supported in jruby we fallback to using spawn.
Fixes: https://github.com/rails/rails/issues/35900
This commit is contained in:
Guilherme Mansur 2019-04-26 18:22:29 -04:00 committed by Guillermo Iguaran
parent 4dfdc7eb90
commit dbcaf9d157
1 changed files with 11 additions and 7 deletions

View File

@ -95,14 +95,18 @@ namespace :test do
])
puts fake_command
# We could run these in parallel, but pretty much all of the
# railties tests already run in parallel, so ¯\_(⊙︿⊙)_/¯
Process.waitpid fork {
ARGV.clear.concat test_options
Rake.application = nil
if Process.respond_to?(:fork)
# We could run these in parallel, but pretty much all of the
# railties tests already run in parallel, so ¯\_(⊙︿⊙)_/¯
Process.waitpid fork {
ARGV.clear.concat test_options
Rake.application = nil
load file
}
load file
}
else
Process.wait spawn(fake_command)
end
unless $?.success?
failing_files << file