rails/rails — pull request #15845 by robin850 (2014-06-21 10:27:03+00:00)
Title: Make the isolated tests run on JRuby

Hello,

This pull request make the tests correctly run in isolation for JRuby. As there is no forking on JRuby, we need to spawn sub-processes to make the tests run in isolation.

Previously, we were defining globally env variables and running the test file through back-ticks and delete these variables once the test ran.

Now, we simply rely on `IO.popen` as this is cross-platform and the env variables are available during the child-process execution only so there are no race conditions.

Thus, we no longer get "ArgumentError: marshal data too short" when running `rake test:isolated`. The only drawback we can see is that since we are using `Process.wait`, on computers with a tiny CPU, the test suite is bit slower to run.

Most of the work have been done by Ben here by the way!

Have a nice day.