Many lock-closuretree--* files in project dir after spec run
dolzenko opened this issue · comments
I wonder if that is
- normal behaviour
- can be something like
Dir.tmpdir
used for lock storage?
- It is to be expected if you aren't using MySQL or Postgresql in your tests, and you aren't setting
ENV['FLOCK_DIR']
. - 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.