Skip to content

Commit

Permalink
fix: remove files in Azure Blob Storage only once per test run (#3377)
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy authored Oct 18, 2024
1 parent fd2cb31 commit 96a31a9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/artillery/lib/platform/aws-ecs/worker/loadgen-worker
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,15 @@ cleanup () {
CLEANING_UP="yes"

if [[ "$is_azure" = "yes" ]] ; then
if [[ -z "${AZURE_RETAIN_BLOBS:-""}" ]] ; then
# This exits with 0 regardless of whether the pattern matches any
# blobs or not so it's OK to run this multiple times
az storage blob delete-batch \
--account-name "$AZURE_STORAGE_ACCOUNT" \
-s "$azure_storage_container_name" \
--pattern "tests/$test_run_id/*"
if [[ "$is_leader" = "true" ]] ; then
if [[ -z "${AZURE_RETAIN_BLOBS:-""}" ]] ; then
# This exits with 0 regardless of whether the pattern matches any
# blobs or not so it's OK to run this multiple times
az storage blob delete-batch \
--account-name "$AZURE_STORAGE_ACCOUNT" \
-s "$azure_storage_container_name" \
--pattern "tests/$test_run_id/*"
fi
fi
fi

Expand Down

0 comments on commit 96a31a9

Please sign in to comment.