We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ThinkingSphinx::Test.clean
Errno::ENOTEMPTY: Directory not empty
Hello, our tests fail randomly at clean up phase for ThinkingSphinx. It seems it can not delete the indices directory (db/sphinx/test).
db/sphinx/test
Here is our test setup for ThinkingSphinx in Minitest: sphinx_helper.rb
sphinx_helper.rb
# frozen_string_literal: true module SphinxHelper extend ActiveSupport::Concern include Minitest::Hooks included do after(:all) do ThinkingSphinx::Test.stop end setup do S3Stub.stub_all ThinkingSphinx::Test.start_with_autostop end teardown do ThinkingSphinx::Test.clear end around do |&block| DatabaseCleaner.strategy = DatabaseCleaner::ActiveRecord::Deletion.new( except: %w[roles] ) DatabaseCleaner.cleaning(&block) end end def index_sphinx(indices = nil) indices ? ThinkingSphinx::Test.index(indices) : ThinkingSphinx::Test.index sleep 0.01 until SphinxHelper.index_finished? end def self.index_finished? Dir[Rails.root.join(ThinkingSphinx::Test.config.indices_location, '*.{new,tmp}*')].empty? end end
test_helper.rb
# ... ThinkingSphinx::Test.init ThinkingSphinx::Test.config # ...
In test we just include SphinxHelper module and use index_sphinx method after creating the test data with Faker.
index_sphinx
Is it safe to remove manually the indices directory? For example:
# ... teardown do FileUtils.rm_rf('db/sphinx/test') ThinkingSphinx::Test.clear end # ...
Gems: Ruby 3.0.6 Rails 7.0.8.1 ThinkingSphinx 5.5.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, our tests fail randomly at clean up phase for ThinkingSphinx. It seems it can not delete the indices directory (
db/sphinx/test
).Here is our test setup for ThinkingSphinx in Minitest:
sphinx_helper.rb
test_helper.rb
In test we just include SphinxHelper module and use
index_sphinx
method after creating the test data with Faker.Is it safe to remove manually the indices directory? For example:
Gems:
Ruby 3.0.6
Rails 7.0.8.1
ThinkingSphinx 5.5.1
The text was updated successfully, but these errors were encountered: