aboutsummaryrefslogtreecommitdiffstats
path: root/railties/Rakefile
diff options
context:
space:
mode:
authorGuilherme Mansur <guilherme.mansur@shopify.com>2019-04-26 18:22:29 -0400
committerGuillermo Iguaran <guilleiguaran@gmail.com>2019-04-26 17:22:28 -0500
commitdbcaf9d157c9303d617a200e8c4b0832eb8af749 (patch)
tree55d3738a03936277362bea81a58ce37e3450bc98 /railties/Rakefile
parent4dfdc7eb90be905e0e8e583f942091ce12381b37 (diff)
downloadrails-dbcaf9d157c9303d617a200e8c4b0832eb8af749.tar.gz
rails-dbcaf9d157c9303d617a200e8c4b0832eb8af749.tar.bz2
rails-dbcaf9d157c9303d617a200e8c4b0832eb8af749.zip
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
Diffstat (limited to 'railties/Rakefile')
-rw-r--r--railties/Rakefile20
1 files changed, 12 insertions, 8 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
-
- load file
- }
+ 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
+ }
+ else
+ Process.wait spawn(fake_command)
+ end
unless $?.success?
failing_files << file