Skip to content

Commit b1be05b

Browse files
[tests] Handle transient ConnectException in on-device HTTP tests (#11057)
* Add Java.Net.ConnectException handling to global IgnoreIfConnectionFailed helper Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
1 parent b43b141 commit b1be05b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ bool IgnoreIfConnectionFailed (HttpRequestException hrex, out bool connectionFai
141141
return true;
142142
}
143143

144+
if (hrex.InnerException is Java.Net.ConnectException connectEx) {
145+
connectionFailed = true;
146+
Assert.Ignore ($"Ignoring transient connection error: {connectEx}");
147+
return true;
148+
}
149+
144150
return false;
145151
}
146152

0 commit comments

Comments
 (0)