diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs b/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs index 5dda01affb9..bde3ee5b154 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs @@ -128,7 +128,20 @@ protected bool IgnoreIfConnectionFailed (AggregateException aex, out bool connec bool IgnoreIfConnectionFailed (HttpRequestException hrex, out bool connectionFailed) { - return IgnoreIfConnectionFailed (hrex?.InnerException as WebException, out connectionFailed); + connectionFailed = false; + if (hrex == null) + return false; + + if (IgnoreIfConnectionFailed (hrex.InnerException as WebException, out connectionFailed)) + return true; + + if (hrex.InnerException is System.IO.IOException ioEx) { + connectionFailed = true; + Assert.Ignore ($"Ignoring transient IO error: {ioEx}"); + return true; + } + + return false; } bool IgnoreIfConnectionFailed (WebException wex, out bool connectionFailed) @@ -168,6 +181,7 @@ bool IgnoreIfSocketException (Exception ex, out bool connectionFailed) } return false; } + } [Category ("AndroidClientHandler")]