Skip to content

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

Merged
jonathanpeppers merged 4 commits into
mainfrom
copilot/ignore-flaky-nunit-test
Mar 18, 2026
Merged

Ignore transient IO errors in on-device HTTP client handler tests#10962
jonathanpeppers merged 4 commits into
mainfrom
copilot/ignore-flaky-nunit-test

Conversation

Copilot AI commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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>
@jonathanpeppers
jonathanpeppers merged commit 1047b55 into main Mar 18, 2026
5 of 6 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/ignore-flaky-nunit-test branch March 18, 2026 03:25
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants