Skip to content

Ignore transient IO errors in on-device HTTP client handler tests#10962

Open
Copilot wants to merge 4 commits intomainfrom
copilot/ignore-flaky-nunit-test
Open

Ignore transient IO errors in on-device HTTP client handler tests#10962
Copilot wants to merge 4 commits intomainfrom
copilot/ignore-flaky-nunit-test

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Summary

Fixes the flaky Redirect_Without_Protocol_Works test failure in Mono.Android.NET_Tests caused by transient IO/SSL errors on device.

The error was:

System.AggregateException → System.Net.Http.HttpRequestException → System.IO.IOException → Java.IO.IOException
  "Read error: ssl=...: Failure in SSL library, usually a protocol error
   error:...:BAD_DECRYPT ... error:...:DECRYPTION_FAILED_OR_BAD_RECORD_MAC"

Changes

Extended the existing IgnoreIfConnectionFailed(HttpRequestException) method to also check if the HttpRequestException's inner exception is a System.IO.IOException. When such a transient IO error is detected, the test is marked as ignored via Assert.Ignore() instead of failing. This matches the existing pattern where the same method already checks for WebException as an inner exception.

The check is scoped to HttpRequestException with an inner IOException, so it won't broadly mask unrelated IOException failures outside of HTTP request processing.

Testing

This is an on-device test change. The fix follows the exact same pattern as the existing WebException handling in IgnoreIfConnectionFailed(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.

Copilot AI and others added 2 commits March 17, 2026 17:48
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
… 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
Copilot AI requested a review from jonathanpeppers March 17, 2026 18:47
@jonathanpeppers jonathanpeppers marked this pull request as ready for review March 17, 2026 20:47
Copilot AI review requested due to automatic review settings March 17, 2026 20:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 new IgnoreIfIOException(...) helper.
  • Adds IgnoreIfIOException(...) to walk the exception chain and mark tests ignored when an IOException is encountered.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants