[ci] Automatically retry failed apk-instrumentation tests.#7963
Merged
Conversation
pjcollins
approved these changes
Apr 17, 2023
Member
pjcollins
left a comment
There was a problem hiding this comment.
Looks like this is working, the task starts execution again once when the first failure is hit: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7639356&view=logs&j=5ded96ba-e325-5baf-fde0-f1868aa3be52&s=c0e518c4-75a6-5e9c-252b-b8e5e80bbfea&t=2d1ebd84-6892-5f1f-bc35-ed96a8e57a24&l=5498
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Apr 24, 2023
* main: [Xamarin.Android.Build.Tasks] enable ForceInterpretedInvoke switch (dotnet#7972) [Mono.Android] Bind API-UpsideDownCake Beta 1 (dotnet#7980) Bump to xamarin/xamarin-android-tools/main@8bc07503 (dotnet#7863) [automation] Add 'xaSourcePath' to yaml so they can be used from monodroid. (dotnet#7978) Bump to dotnet/installer@16c10f8115 8.0.100-preview.4.23218.1 (dotnet#7969) [docs] Add UnitTest.md (dotnet#7877) [ci] Suppress fork PR build warnings (dotnet#7973) [Xamarin.Android.Build.Tasks] Bump ZipFlushFilesLimit (dotnet#7957) Bump to dotnet/installer@3ca7ad1c79 8.0.100-preview.4.23211.1 (dotnet#7946) [CI] Allow passing xamarin-android checkout dir to nested templates. (dotnet#7961) [Xamarin.Android.Build.Tasks] Fix `-int.ToString()` for locales (dotnet#7941) [ci] Automatically retry failed apk-instrumentation tests. (dotnet#7963)
jpobst
added a commit
that referenced
this pull request
May 3, 2023
[Previously](#7963), we have used `retryCountOnTaskFailure` to retry some of our flaky test suites. However this is not a good solution for our MSBuild and emulator tests for 2 reasons: - Running each suite takes 30-60 minutes, so it would take a long time to retry the entire suite. - The suites are very flaky, and rerunning the entire suite would likely result in test(s) that were successful on the first run to fail on the second. We need a solution that only retries the specific test(s) that failed. Unfortunately nothing like that exists, so we'll once again have to roll our own solution, and we can reuse `dotnet-test-slicer` for this. This involves some trickery to make everything show up correctly in the AzDO UI: - Run the initial test suite - Run in a Powershell so we can ignore any test failures that would move the pipeline into `SucceededWithIssues` state - Do not automatically publish the test results, as they would contain test failures - Run `dotnet-test-slicer retry` - This creates a new `.runsettings` file that only contains the failed tests so `dotnet test` can run only them - It also rewrites the test results file of the initial run and removes any failed tests from so it can be published to AzDO - Publish the successful tests from the first run to AzDO - Run the retried tests - This time we can use normal `dotnet`, and any test failures can be automatically reported to AzDO Affected Test Suites: - MSBuild Emulator Tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
apk-instrumentationtests are a good candidate for usingretryCountOnTaskFailure. 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.
Ironically, you can see it in action on this build because we have an HTTP test that is currently failing with 504. 🤷♂️