-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1304943
Build error leg or test failing: System.Net.NameResolution.Tests.GetHostEntryTest.DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamily, System.Net.NameResolution.Tests.GetHostAddressesTest.DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily
Error Message
Fill the error message using step by step known issues guidance.
{
"ErrorMessage": "LocalhostSubdomain_RespectsAddressFamily",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}Description
The DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamily and DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily tests (introduced in PR #123076 for RFC 6761 localhost subdomain handling) consistently fail on Android CI (windows.11.amd64.android.open queue).
Error
System.Net.Sockets.SocketException : hostname nor servname provided, or not known
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, ...)
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, ...)
at System.Net.Dns.GetHostEntryCore(String hostName, AddressFamily addressFamily, ...)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress, AddressFamily family)
Analysis
- The tests call e.g.
Dns.GetHostEntry("test.localhost", AddressFamily.InterNetwork)(orInterNetworkV6). - The RFC 6761 implementation tries the OS resolver for
"test.localhost"first, then falls back to resolving plain"localhost"with the sameAddressFamily. - The double
GetHostEntryOrAddressesCorein the stack trace confirms the fallback triggers but also fails. - The fallback calls
getaddrinfo("localhost", ..., ai_family)with a specific address family (AF_INETorAF_INET6). On Android, this may fail (EAI_NONAME) whilegetaddrinfo("localhost", ..., AF_UNSPEC)succeeds. - Other localhost subdomain tests that use
AddressFamily.Unspecified(e.g.ReturnsLoopback) pass on Android. - There are no non-
[OuterLoop]tests that callDns.GetHostEntry("localhost", AddressFamily.InterNetwork)directly to confirm if family-specific localhost resolution works on Android in general.
CI Data (last 14 days, main branch)
| Build | GetHostEntry failures | GetHostAddresses failures |
|---|---|---|
| 1303735 | 3 | 3 |
| 1304312 | 1 | 1 |
| 1304943 | 2 | 2 |
Each Android job has exactly 1 failure per test (the test has 2 InlineData values: InterNetwork and InterNetworkV6), suggesting only one address family variant fails per run.
Console log example
Possible fixes
- Fix the fallback to resolve
"localhost"withAddressFamily.Unspecifiedand then filter results by the requested family. - Investigate whether family-specific
getaddrinfo("localhost", AF_INET/AF_INET6)is expected to work on Android and fix the emulator setup.
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1304943
Error message validated: [LocalhostSubdomain_RespectsAddressFamily]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 2/23/2026 12:30:22 PM UTC
Report
| Build | Definition | Test | Pull Request |
|---|---|---|---|
| 1304943 | dotnet/runtime | System.Net.NameResolution.Functional.Tests.WorkItemExecution |
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 1 | 1 |