dougal / acts_as_indexed

Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app
http://douglasfshearer.com/blog/rails-plugin-acts_as_indexed
MIT License
211 stars 49 forks source link

Errors on tests running in parallel #55

Open marcelopazzo opened 10 years ago

marcelopazzo commented 10 years ago

Hi,

I have a RefineryCMS project updated to latest stable version (2.1.3) and after integrate my tests with parallel_tests and zeus (using zeus-parallel_tests), this error is happening randomly on different tests

     Failure/Error: Unable to find matching line from backtrace
     Errno::ENOENT:
       No such file or directory - /Users/marcelopazzo/dev/project/tmp/index/test/refinery/user/114_101_102.ind.tmp
     # <internal:prelude>:10:in `synchronize'
     # -e:1:in `<main>'

These errors looks like what @daveharris reported on #53

I'm trying to fix the errors using different index folders for each processor, but for some reason, even with the code below on my spec_helper.rb, some tests are looking for files on the default index folder:

RSpec.configure do |config|
  config.before :suite do
    ActsAsIndexed.configuration.index_file = [Rails.root, 'tmp', "parallel_index#{ENV['TEST_ENV_NUMBER']}"]
  end
end

Do you have any advice on how I can make this work?