I have some Rspec tests that are sometimes failing with an error: Circular dependency detected while autoloading constant
. These tests are multithreaded (rufus-scheduler tests), which is apparently a known problem for autoloading code (http://route.github.io/2013/11/13/rails-autoloading.html).
I can get the tests to work consistently if I set config.eager_load = true
in config/environments/test.rb. However, I'm worried that this will really slow down the rest of my test suite when it grows larger. Is there any way to set this eager load option ONLY for my multithreaded tests?
Rails 4.1.4