Skip to content
New issue

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

Many lock-closuretree--* files in project dir after spec run #3

Closed
dolzenko opened this issue Mar 12, 2013 · 1 comment
Closed

Many lock-closuretree--* files in project dir after spec run #3

dolzenko opened this issue Mar 12, 2013 · 1 comment

Comments

@dolzenko
Copy link

I wonder if that is

  1. normal behaviour
  2. can be something like Dir.tmpdir used for lock storage?
@mceachen
Copy link
Collaborator

  1. It is to be expected if you aren't using MySQL or Postgresql in your tests, and you aren't setting ENV['FLOCK_DIR'].
  2. In your spec_helper or minitest_helper, add a before and after block:
before do
  ENV['FLOCK_DIR'] = Dir.mktmpdir
  
end

after do
  FileUtils.remove_entry_secure ENV['FLOCK_DIR']
end

If you're using sqlite in your production code, make sure the same FLOCK_DIR value (that isn't a temporary directory) is set consistently across all ruby processes. I'll add a reference to this in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants