From dbcaf9d157c9303d617a200e8c4b0832eb8af749 Mon Sep 17 00:00:00 2001 From: Guilherme Mansur Date: Fri, 26 Apr 2019 18:22:29 -0400 Subject: [PATCH] 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 --- railties/Rakefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/railties/Rakefile b/railties/Rakefile index 0f305ea332..51f46d1817 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -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