Skip to content

Commit

Permalink
test: Ignore removing ephemeral buffer files
Browse files Browse the repository at this point in the history
This is because Windows does not permit to remove files which are used in another process.

Signed-off-by: Hiroshi Hatake <hatake@clear-code.com>
  • Loading branch information
cosmo0920 committed Mar 5, 2020
1 parent 2b90b06 commit 7ae24c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/plugin/test_buf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,9 @@ def write_metadata(path, chunk_id, metadata, size, ctime, mtime)
if @bufdir
Dir.glob(File.join(@bufdir, '*')).each do |path|
next if ['.', '..'].include?(File.basename(path))
File.delete(path)
# Windows does not permit to delete files which are used in another process.
# Just ignore for removing failure.
File.delete(path) rescue nil
end
end
end
Expand Down

0 comments on commit 7ae24c5

Please sign in to comment.