You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.NetTests.SslTest.HttpsShouldWork intermittently fails in on-device test runs when the live external endpoints it depends on return an HTTP server error. Most recently it failed with a 504 Gateway Time-out.
Failure
failed HttpsShouldWork
System.Net.WebException : net_servererror, 504, Gateway Time-out
at System.NetTests.SslTest.RunIgnoringWebException(Action test)
at System.NetTests.SslTest.HttpsShouldWork()
at System.RuntimeMethodHandle.InvokeMethod(...)
...
from /Users/runner/work/1/s/bin/TestRelease/net11.0-android/Mono.Android.NET-Tests.dll (net11.0|x64)
A 504 Gateway Time-out is a server-side HTTP status error (net_servererror, i.e. WebExceptionStatus.ProtocolError), which is not in the ignore list, so the test fails instead of being ignored. The existing per-URL fallback only handles 429 Too Many Requests, not 5xx responses:
if(response.StatusCode==HttpStatusCode.TooManyRequests){// try the next url.continue;}
This is a recurring class of flakiness for this test: it depends on the availability and health of external endpoints that the CI environment does not control.
Previous related issues
CoreCLR on-device tests #10069 — CoreCLR on-device tests (CLOSED). Referenced by the // TODO: https://github.com/dotnet/android/issues/10069 comment at the top of SslTest.cs; about enabling CoreCLR on-device tests generally, not this specific flakiness.
Previous related PRs (network-resilience history for this test)
[tests] More network resilience for tests #2954 — [tests] More network resilience for tests (2019, merged). Added the RunIgnoringWebException / ShouldIgnoreException helper that ignores ConnectFailure / NameResolutionFailure / Timeout. This is why the current 504 slips through — it is not one of those statuses.
112c8328a6 (2023) — Added the multi-URL list (dotnet.microsoft.com, bing.com) plus the HttpStatusCode.TooManyRequests (429) fallback. Handles 429, not 5xx.
[tests] Use local servers for networking tests #12022 — [tests] Use local servers for networking tests (2026-07, merged). Migrated sibling SSL/net tests to local loopback / self-signed HTTPS servers, but HttpsShouldWork was left on live external URLs (it only removed httpbin.org from the list). This test is the remaining external-URL dependency.
Summary
System.NetTests.SslTest.HttpsShouldWorkintermittently fails in on-device test runs when the live external endpoints it depends on return an HTTP server error. Most recently it failed with a504 Gateway Time-out.Failure
System.NetTests.SslTest.HttpsShouldWorktests/Mono.Android-Tests/Mono.Android-Tests/System.Net/SslTest.csRoot cause
HttpsShouldWorkmakes real HTTPS requests to live external URLs:https://dotnet.microsoft.com/https://www.bing.com/The call is wrapped in
RunIgnoringWebException, which only ignores transient network failures:A
504 Gateway Time-outis a server-side HTTP status error (net_servererror, i.e.WebExceptionStatus.ProtocolError), which is not in the ignore list, so the test fails instead of being ignored. The existing per-URL fallback only handles429 Too Many Requests, not 5xx responses:This is a recurring class of flakiness for this test: it depends on the availability and health of external endpoints that the CI environment does not control.
Previous related issues
// TODO: https://github.com/dotnet/android/issues/10069comment at the top ofSslTest.cs; about enabling CoreCLR on-device tests generally, not this specific flakiness.No existing issue tracks this specific failure.
Previous related PRs (network-resilience history for this test)
RunIgnoringWebException/ShouldIgnoreExceptionhelper that ignoresConnectFailure/NameResolutionFailure/Timeout. This is why the current 504 slips through — it is not one of those statuses.112c8328a6(2023) — Added the multi-URL list (dotnet.microsoft.com,bing.com) plus theHttpStatusCode.TooManyRequests(429) fallback. Handles 429, not 5xx.ProxyTest, explicitly modeled onSslTest.HttpsShouldWorkwas left on live external URLs (it only removedhttpbin.orgfrom the list). This test is the remaining external-URL dependency.Suggested fix
Either of:
HttpsShouldWorkto use a local loopback / self-signed HTTPS server, consistent with the direction of [tests] Use local servers for networking tests #12022.504) as ignorable / inconclusive network failures, matching the existing429handling andRunIgnoringWebExceptionbehavior.