FIX: parallel spec system needs needs a dedicated upload folder for each worker. (#8372)

This commit is contained in:
Vinoth Kannan 2019-11-19 13:16:20 +05:30 committed by GitHub
parent f83125f0c2
commit 42e5176bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,13 @@ module FileStore
end
def upload_path
File.join("uploads", RailsMultisite::ConnectionManagement.current_db)
if ENV['RAILS_ENV'] != "test" || !ENV['TEST_ENV_NUMBER']
return File.join("uploads", RailsMultisite::ConnectionManagement.current_db)
end
# Parallel spec system
n = ENV['TEST_ENV_NUMBER'].presence || '1'
File.join("uploads", RailsMultisite::ConnectionManagement.current_db, n)
end
def has_been_uploaded?(url)