Skip to content

Commit

Permalink
[ci] Automatically retry failed apk-instrumentation tests. (#7963)
Browse files Browse the repository at this point in the history
The `apk-instrumentation` tests are a good candidate for using `retryCountOnTaskFailure`.  This is because they only take a few minutes to run, and have a low enough flaky rate that it is likely that rerunning the entire test suite will succeed.

As noted in dotnet/java-interop#1095, AzDO's support for this isn't perfect.  The initial failure will still show up in the Error Log, however the task will be green and will not show up as a failed build.
  • Loading branch information
jpobst committed Apr 17, 2023
1 parent 90afbdd commit bff7242
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parameters:
artifactFolder: ""
useDotNet: true
condition: succeeded()
retryCountOnTaskFailure: 1

steps:
- ${{ if eq(parameters.useDotNet, false) }}:
Expand All @@ -26,6 +27,7 @@ steps:
${{ parameters.extraBuildArgs }}
condition: ${{ parameters.condition }}
continueOnError: true
retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }}

- ${{ if eq(parameters.useDotNet, true) }}:
- template: run-dotnet-preview.yaml
Expand All @@ -40,6 +42,7 @@ steps:
-v:n -c ${{ parameters.configuration }} ${{ parameters.extraBuildArgs }}
condition: ${{ parameters.condition }}
continueOnError: true
retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }}

- script: >
DEST="$(Build.StagingDirectory)/Test${{ parameters.configuration }}/${{ parameters.artifactFolder }}/" &&
Expand Down
2 changes: 2 additions & 0 deletions build-tools/automation/yaml-templates/run-dotnet-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ parameters:
displayName: run dotnet preview
condition: succeeded()
continueOnError: true
retryCountOnTaskFailure: 0

steps:
- powershell: |
Expand All @@ -25,3 +26,4 @@ steps:
displayName: ${{ parameters.displayName }}
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }}

0 comments on commit bff7242

Please sign in to comment.