Use Assert.Inconclusive for emulator acquisition failures#11110
Open
jonathanpeppers wants to merge 4 commits intomainfrom
Open
Use Assert.Inconclusive for emulator acquisition failures#11110jonathanpeppers wants to merge 4 commits intomainfrom
jonathanpeppers wants to merge 4 commits intomainfrom
Conversation
Emulator acquisition failures are infrastructure issues, not test failures. Using Assert.Inconclusive instead of Assert.IsTrue marks these as skipped/inconclusive rather than turning the build red. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates device/emulator test infrastructure so emulator acquisition problems are treated as inconclusive (skipped) rather than hard test failures, reducing CI “red” builds caused by transient emulator/ADB issues.
Changes:
- Change
DeviceTest.RestartDevice()to callAssert.Inconclusive()whenAcquireAndroidTargetfails instead ofAssert.IsTrue().
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
Show resolved
Hide resolved
Check LastBuildOutput for known transient patterns before marking as Inconclusive. Unknown failures still Assert.Fail with the full build output for investigation. Transient patterns: - 'did not finish launching' (boot timeout) - 'Emulator failed to start' (start failure) - 'failed to exit within the timeout' (adb timeout) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Emulator acquisition failures in
DeviceTest.RestartDevice()are infrastructure issues (unresponsive emulator, boot timeout, Vulkan driver errors), not actual test failures. This changes the assertion fromAssert.IsTruetoAssert.Inconclusiveso that these tests are marked as skipped/inconclusive rather than turning the build red.Context
In build 13830308,
DotNetInstallAndRunPreviousSdk(True, MonoVM)andDotNetInstallAndRunPreviousSdk(False, NativeAOT)both failed with:Failed to acquire emulator. Expected: True But was: FalseThe WearOS emulator was present (emulator-5570) but
adb shell echo OKtimed out — a pure infrastructure issue that shouldn't mark tests as failed.