From 81708fd84dbf9ed5cba7cc2cbc1ef18872fc52db Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Sun, 23 Aug 2026 09:07:17 +0200 Subject: [PATCH] The file manager spec cleans its directory before it fills it One run out of a dozen failed on "creates a folder and returns to the directory": the spec created its artifact directory under `tmp/` and only removed it afterwards, so anything left behind by an interrupted run was still there when the next one started, and `mkdir` on an existing folder answers with the alert instead of the notice. It removes the directory first now. The suite is green across ten consecutive runs and every seed tried, including the one that failed. Co-Authored-By: Claude Opus 5 (1M context) --- apps/api/spec/requests/admin_files_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/api/spec/requests/admin_files_spec.rb b/apps/api/spec/requests/admin_files_spec.rb index 556d27c..a3bca72 100644 --- a/apps/api/spec/requests/admin_files_spec.rb +++ b/apps/api/spec/requests/admin_files_spec.rb @@ -8,6 +8,7 @@ RSpec.describe "Admin file manager", type: :request do let(:container) { Rails.root.join("tmp/files-spec").to_s } before do + FileUtils.rm_rf(container) FileUtils.mkdir_p(File.join(container, "mygame-1.0")) File.write(File.join(container, "mygame-1.0.zip"), "zipdata") allow(WarpEngine.config).to receive(:file_container_path).and_return(container)