Ignore transient IO errors in on-device HTTP client handler tests#10962
Open
Ignore transient IO errors in on-device HTTP client handler tests#10962
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jonathanpeppers
March 17, 2026 18:17
View session
tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs
Outdated
Show resolved
Hide resolved
… keywords Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
Ignore transient SSL errors in on-device HTTP client handler tests
Ignore transient IO errors in on-device HTTP client handler tests
Mar 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Improves reliability of on-device HttpClientHandler tests by ignoring transient IO-related failures that can occur on Android devices during SSL/network operations.
Changes:
- Extends
IgnoreIfConnectionFailed(AggregateException, ...)to also ignore failures detected by a newIgnoreIfIOException(...)helper. - Adds
IgnoreIfIOException(...)to walk the exception chain and mark tests ignored when anIOExceptionis encountered.
tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
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
Fixes the flaky
Redirect_Without_Protocol_Workstest failure inMono.Android.NET_Testscaused by transient IO/SSL errors on device.The error was:
Changes
Extended the existing
IgnoreIfConnectionFailed(HttpRequestException)method to also check if theHttpRequestException's inner exception is aSystem.IO.IOException. When such a transient IO error is detected, the test is marked as ignored viaAssert.Ignore()instead of failing. This matches the existing pattern where the same method already checks forWebExceptionas an inner exception.The check is scoped to
HttpRequestExceptionwith an innerIOException, so it won't broadly mask unrelatedIOExceptionfailures outside of HTTP request processing.Testing
This is an on-device test change. The fix follows the exact same pattern as the existing
WebExceptionhandling inIgnoreIfConnectionFailed(HttpRequestException).📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.