From ef47a1d9184df34c3b31ee5b3dfabdea7bf8cd0f Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Sun, 18 Feb 2024 15:16:49 +0300 Subject: [PATCH] fix: CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run --- spec/spec_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 91e4577..33be5a1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -119,7 +119,7 @@ def save_exception_artifacts(browser, meta) end def save_exception_screenshot(browser, filename, line_number, timestamp) - screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}.png" + screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}-#{rand(1000)}.png" screenshot_path = "/tmp/cuprite/#{screenshot_name}" browser.screenshot(path: screenshot_path, full: true) rescue StandardError => e @@ -127,7 +127,7 @@ def save_exception_screenshot(browser, filename, line_number, timestamp) end def save_exception_log(browser, filename, line_number, timestamp) - log_name = "logfile-#{filename}-#{line_number}-#{timestamp}.txt" + log_name = "logfile-#{filename}-#{line_number}-#{timestamp}-#{rand(1000)}.txt" File.binwrite("/tmp/cuprite/#{log_name}", browser.options.logger.string) rescue StandardError => e puts "#{e.class}: #{e.message}"