DEV: Fix race conditions due to directory removal for uploads spec.

DEV: Fix race conditions due to directory removal for uploads spec.

diff --git a/spec/components/file_store/base_store_spec.rb b/spec/components/file_store/base_store_spec.rb
index c58818a..708235d 100644
--- a/spec/components/file_store/base_store_spec.rb
+++ b/spec/components/file_store/base_store_spec.rb
@@ -47,8 +47,6 @@ RSpec.describe FileStore::BaseStore do
 
   describe '#download' do
     before do
-      `rm -rf #{FileStore::BaseStore::CACHE_DIR}`
-
       SiteSetting.enable_s3_uploads = true
       SiteSetting.s3_upload_bucket = "s3-upload-bucket"
       SiteSetting.s3_access_key_id = "some key"
diff --git a/spec/fabricators/upload_fabricator.rb b/spec/fabricators/upload_fabricator.rb
index c2f6952..65e4a1b 100644
--- a/spec/fabricators/upload_fabricator.rb
+++ b/spec/fabricators/upload_fabricator.rb
@@ -2,7 +2,7 @@
 
 Fabricator(:upload) do
   user
-  sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }
+  sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest("#{n}#{Process.pid}") } }
   original_filename "logo.png"
   filesize 1234
   width 100

GitHub sha: 04a291ce

1 Like