Skip to content

[tests] Mark ProxyTest as Inconclusive on network failure - #11288

Merged
simonrozsival merged 2 commits into
mainfrom
jonathanpeppers/inconclusive-network-errors
May 6, 2026
Merged

[tests] Mark ProxyTest as Inconclusive on network failure#11288
simonrozsival merged 2 commits into
mainfrom
jonathanpeppers/inconclusive-network-errors

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Summary

Mark ProxyTest.QuoteInvalidQuoteUrlsShouldWork as Assert.Inconclusive() on network failure instead of failing the test. This matches the existing pattern used in SslTest and other network-dependent tests.

Problem

The test fails when DNS resolution is unavailable on the test machine:

System.Net.WebException : hostname nor servname provided, or not known (www.msftconnecttest.com:80)
----> System.Net.Http.HttpRequestException : hostname nor servname provided, or not known (www.msftconnecttest.com:80)
----> System.Net.Sockets.SocketException : hostname nor servname provided, or not known
at System.Net.HttpWebRequest.GetResponse()
at System.NetTests.ProxyTest.QuoteInvalidQuoteUrlsShouldWork()
at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean)
--HttpRequestException
at System.Net.Http.HttpConnectionPool.<ConnectToTcpHostAsync>d__54.MoveNext()
--- End of stack trace from previous location ---
at System.Net.Http.HttpConnectionPool.<ConnectAsync>d__53.MoveNext()
--- End of stack trace from previous location ---
at System.Net.Http.HttpConnectionPool.<CreateHttp11ConnectionAsync>d__82.MoveNext()
--- End of stack trace from previous location ---
at System.Net.Http.HttpConnectionPool.<InjectNewHttp11ConnectionAsync>d__81.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellation(CancellationToken)
at System.Net.Http.HttpConnectionPool.<SendWithVersionDetectionAndRetryAsync>d__52.MoveNext()
--- End of stack trace from previous location ---
at System.Net.Http.RedirectHandler.<SendAsync>d__4.MoveNext()
--- End of stack trace from previous location ---
at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage, CancellationToken)
at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage, CancellationToken)
at System.Net.Http.HttpClient.Send(HttpRequestMessage, HttpCompletionOption, CancellationToken)
at System.Net.HttpWebRequest.SendRequest(Boolean, HttpContent)
at System.Net.HttpWebRequest.<HandleResponse>d__201.MoveNext()
--- End of stack trace from previous location ---
at System.Net.HttpWebRequest.GetResponse()
--SocketException
at System.Net.Dns.GetHostEntryOrAddressesCore(String, Boolean, AddressFamily, Nullable`1)
at System.Net.Dns.GetHostAddresses(String, AddressFamily)
at System.Net.HttpWebRequest.<>c__DisplayClass224_0.<<CreateHttpClient>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at System.Net.Http.HttpConnectionPool.<ConnectToTcpHostAsync>d__54.MoveNext()

Fix

Wrap the test body in a try/catch that catches WebException with ConnectFailure, NameResolutionFailure, or Timeout status and calls Assert.Inconclusive().

…work failure
Catch WebException for ConnectFailure, NameResolutionFailure, and
Timeout and call Assert.Inconclusive() instead of failing. This
matches the pattern used in SslTest and other network-dependent tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings May 5, 2026 13:27

CopilotAI 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

This PR adjusts a flaky Mono.Android-Tests network test so transient connectivity problems on the test machine no longer fail the suite outright. It targets System.Net test stability rather than product/runtime behavior.

Changes:

  • Wraps ProxyTest.QuoteInvalidQuoteUrlsShouldWork() in a try/catch.
  • Treats ConnectFailure, NameResolutionFailure, and TimeoutWebExceptions as non-failures.
  • Reports those transient failures via an NUnit non-passing result instead of a hard test failure.

Comment threadtests/Mono.Android-Tests/Mono.Android-Tests/System.Net/ProxyTest.cs Outdated
…ttern
All other network failure handlers in this test suite use Assert.Ignore.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppersjonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label May 5, 2026
@simonrozsival
simonrozsival merged commit 3115293 into mainMay 6, 2026
3 checks passed
@simonrozsival
simonrozsival deleted the jonathanpeppers/inconclusive-network-errors branch May 6, 2026 08:23
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jun 5, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-reviewThis PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jonathanpeppers@simonrozsival