diff --git a/tools/devops/automation/scripts/bash/clean-simulator-runtime.sh b/tools/devops/automation/scripts/bash/clean-simulator-runtime.sh index 3e55e489fd3d..82c061ee3b75 100755 --- a/tools/devops/automation/scripts/bash/clean-simulator-runtime.sh +++ b/tools/devops/automation/scripts/bash/clean-simulator-runtime.sh @@ -12,9 +12,9 @@ done # delete all simulators not used in the last 90 days echo "Checking if there are any old runtimes to delete:" -xcrun simctl runtime delete --notUsedSinceDays 90 --dry-run | sed 's/^/ /' +xcrun simctl runtime delete --notUsedSinceDays 90 --dry-run | sed 's/^/ /' || true echo "Deleting..." -xcrun simctl runtime delete --notUsedSinceDays 90| sed 's/^/ /' +xcrun simctl runtime delete --notUsedSinceDays 90 | sed 's/^/ /' || true echo "Delete completed." xcrun simctl runtime list -j > simruntime.json @@ -50,6 +50,22 @@ do done done < simruntime-duplicated-runtimes.txt || true +# delete unusable runtimes +for runtime in $(xcrun simctl runtime list | grep Unusable | sed -e 's/Unusable.*//' -e 's/^.*\([A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9]-[A-Z0-9]*-[A-Z0-9]*-[A-Z0-9]*-[A-Z0-9]*\).*$/\1/'); do + echo "Deleting the runtime $runtime, it's unusable" + xcrun simctl runtime delete "$runtime" +done +# wait for them to actually be deleted +C=0 +while xcrun simctl runtime list | grep Deleting; do + sleep 1 + # stop looping after 60 seconds + (( C++ )) + if [[ $C -gt 60 ]]; then + break + fi +done + xcrun simctl runtime list -v || true xcrun simctl runtime match list -v || true diff --git a/tools/devops/automation/templates/tests/build.yml b/tools/devops/automation/templates/tests/build.yml index 54f5ea55390d..fa24a4a8f788 100644 --- a/tools/devops/automation/templates/tests/build.yml +++ b/tools/devops/automation/templates/tests/build.yml @@ -218,7 +218,7 @@ steps: # Use the provisionator to install the test dependencies. Those have been generated in the 'Generate Provisionator csx file' step. - task: xamops.azdevex.provisionator-task.provisionator@2 - displayName: 'Provision dependencies' + displayName: 'Provisionator dependencies' inputs: provisioning_script: $(System.DefaultWorkingDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/build-provisioning.csx provisioning_extra_args: '-vvvv' @@ -242,7 +242,7 @@ steps: ARGS+=(--ignore-shellcheck) ARGS+=(--ignore-yamllint) $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/system-dependencies.sh "${ARGS[@]}" - displayName: 'Provision dependencies' + displayName: 'Provision system dependencies' timeoutInMinutes: 250 env: XCODE_CHANNEL: ${{ parameters.XcodeChannel }}