Skip to content

Comments

Disable localhost subdomain AddressFamily tests on Android#124752

Merged
rzikm merged 1 commit intodotnet:mainfrom
rzikm:fix/disable-android-localhost-subdomain-tests
Feb 23, 2026
Merged

Disable localhost subdomain AddressFamily tests on Android#124752
rzikm merged 1 commit intodotnet:mainfrom
rzikm:fix/disable-android-localhost-subdomain-tests

Conversation

@rzikm
Copy link
Member

@rzikm rzikm commented Feb 23, 2026

Disables DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamily and DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily on Android using [ActiveIssue].

Problem

These tests (introduced in #123076 for RFC 6761 localhost subdomain handling) consistently fail on Android CI (windows.11.amd64.android.open):

System.Net.Sockets.SocketException : hostname nor servname provided, or not known
   at System.Net.Dns.GetHostEntryOrAddressesCore(...)
   at System.Net.Dns.GetHostEntryOrAddressesCore(...)  // fallback for "localhost"
   at System.Net.Dns.GetHostEntryCore(...)
   at System.Net.Dns.GetHostEntry(...)

The tests call e.g. Dns.GetHostEntry("test.localhost", AddressFamily.InterNetwork). The RFC 6761 implementation tries the OS resolver for "test.localhost" first, then falls back to resolving "localhost" with the same AddressFamily. On Android, getaddrinfo("localhost", ..., AF_INET/AF_INET6) may fail with EAI_NONAME while getaddrinfo("localhost", ..., AF_UNSPEC) succeeds — causing both the initial and fallback resolution to fail.

Other localhost subdomain tests that use AddressFamily.Unspecified (e.g. ReturnsLoopback) pass on Android.

Example console log: https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-76f79e897d5246b58a/System.Net.NameResolution.Functional.Tests/1/console.858b3560.log?helixlogtype=result

Contributes to #124751

The DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamily and
DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily tests
fail on Android because getaddrinfo with a specific address family
(AF_INET or AF_INET6) for 'localhost' may return EAI_NONAME, while
AF_UNSPEC succeeds. The RFC 6761 fallback passes the address family
through, causing both the initial and fallback resolution to fail.

Fixes dotnet#124751

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 23, 2026 12:25
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables two System.Net.NameResolution functional tests that validate *.localhost subdomain resolution with AddressFamily filtering on Android, due to consistent CI failures tied to Android resolver behavior.

Changes:

  • Mark DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamily as skipped on Android via [ActiveIssue].
  • Mark DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily as skipped on Android via [ActiveIssue].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs Adds [ActiveIssue(..., TestPlatforms.Android)] to disable the AddressFamily localhost-subdomain test on Android.
src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostAddressesTest.cs Adds [ActiveIssue(..., TestPlatforms.Android)] to disable the AddressFamily localhost-subdomain test on Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants