Skip to content

[mobile] Skip failing Android localhost subdomain DNS tests#127742

Merged
kotlarmilos merged 4 commits intomainfrom
mobile-fix-android-localhost-subdomain-45341ff49b7b78a5
May 5, 2026
Merged

[mobile] Skip failing Android localhost subdomain DNS tests#127742
kotlarmilos merged 4 commits intomainfrom
mobile-fix-android-localhost-subdomain-45341ff49b7b78a5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 4, 2026

Summary

Fixes failing System.Net.NameResolution tests on Android by adding ActiveIssue attributes to skip tests that expect localhost subdomain resolution to return loopback addresses.

Details

On Android, DNS resolution for .localhost subdomains (e.g., foo.localhost, test.localhost) returns link-local IPv6 addresses (fe80::/10) instead of loopback addresses, causing test failures.

Tests Fixed

  • DnsGetHostEntry_LocalhostSubdomain_ReturnsLoopback
  • DnsGetHostAddresses_LocalhostSubdomain_ReturnsLoopback

These tests are now skipped on Android with reference to existing issue #124751, which already tracks the same underlying problem for the RespectsAddressFamily variants of these tests.

Build Information

  • Build: 1406427
  • Date: 2026-05-03
  • Job: android-arm Release AllSubsets_Mono
  • Helix Job: 6255e58e-bf4f-4c25-ba48-27c957d4ea3e
  • Work Item: System.Net.NameResolution.Functional.Tests

Console Log Excerpt (sanitized)

[20:56:01] info: Instrumentation finished normally with exit code 1
[FAIL] System.Net.NameResolution.Tests.GetHostAddressesTest.DnsGetHostAddresses_LocalhostSubdomain_ReturnsLoopback(hostName: "foo.localhost")
Assert.All() Failure: 2 out of 3 items in the collection did not pass.
     Error: Expected loopback address but got: fe80::cb7c:d6fd:eb1f:6f44%10
     Error: Expected loopback address but got: fe80::b4f2:efff:fea1:dbef%3
[FAIL] System.Net.NameResolution.Tests.GetHostAddressesTest.DnsGetHostAddresses_LocalhostSubdomain_ReturnsLoopback(hostName: "test.localhost")
Assert.All() Failure: 2 out of 3 items in the collection did not pass.
     Error: Expected loopback address but got: fe80::cb7c:d6fd:eb1f:6f44%10
     Error: Expected loopback address but got: fe80::b4f2:efff:fea1:dbef%3

The tests receive link-local IPv6 addresses instead of the expected loopback addresses (127.0.0.1 or ::1).

Root Cause

Android's DNS resolver behavior for RFC 6761 localhost subdomains differs from desktop platforms. When the OS resolver fallback tries to resolve plain "localhost" with or without an address family filter, Android may return the device's network interface addresses instead of loopback addresses.

Related Issue

Closes: #124751

Note

This content was generated by GitHub Copilot and may contain AI-generated content.

Note

🔒 Integrity filter blocked 2 items

The following items were blocked because they don't meet the GitHub integrity level.

  • #19443 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #126805 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Mobile Platform Failure Scanner · ● 3.6M ·

Skip System.Net.NameResolution tests that fail on Android due to
localhost subdomain resolution returning link-local IPv6 addresses
instead of loopback addresses.

Adds ActiveIssue attribute for issue #124751 to:
- DnsGetHostEntry_LocalhostSubdomain_ReturnsLoopback
- DnsGetHostAddresses_LocalhostSubdomain_ReturnsLoopback

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406427
Failed work item: System.Net.NameResolution.Functional.Tests
Helix job: 6255e58e-bf4f-4c25-ba48-27c957d4ea3e

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@kotlarmilos kotlarmilos marked this pull request as ready for review May 4, 2026 15:30
Copilot AI review requested due to automatic review settings May 4, 2026 15:30
Copy link
Copy Markdown
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

This PR updates System.Net.NameResolution functional tests to avoid consistent Android failures by skipping the localhost-subdomain loopback assertions on Android via ActiveIssue.

Changes:

  • Skip DnsGetHostEntry_LocalhostSubdomain_ReturnsLoopback on Android with an ActiveIssue attribute.
  • Skip DnsGetHostAddresses_LocalhostSubdomain_ReturnsLoopback on Android with an ActiveIssue attribute.
Show a summary per file
File Description
src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs Adds an Android ActiveIssue skip for the localhost-subdomain loopback theory.
src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostAddressesTest.cs Adds an Android ActiveIssue skip for the localhost-subdomain loopback theory.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs Outdated
kotlarmilos and others added 2 commits May 5, 2026 09:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kotlarmilos kotlarmilos enabled auto-merge (squash) May 5, 2026 07:44
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 5, 2026

🤖 Copilot Code Review — PR #127742

Note

This review was generated by GitHub Copilot.

Holistic Assessment

Motivation: Justified. These two DNS tests (DnsGetHostAddresses_LocalhostSubdomain_ReturnsLoopback and DnsGetHostEntry_LocalhostSubdomain_ReturnsLoopback) are failing on Android because localhost subdomain resolution returns link-local IPv6 addresses instead of loopback. Skipping them with a tracking issue is the standard approach in dotnet/runtime.

Approach: Correct. Adding [ActiveIssue] with TestPlatforms.Android targeting is the established pattern in this test file and across the repository.

Summary: ✅ LGTM. The change is minimal, correctly scoped, and follows established conventions. The tracking issue (#126456) is already referenced by sibling tests in the same files, confirming it's the correct issue for this class of Android DNS failures.


Detailed Findings

✅ Correctness — Attribute usage is correct

The [ActiveIssue("https://github.com/dotnet/runtime/issues/126456", TestPlatforms.Android)] annotation correctly:

✅ Consistency — Follows existing patterns

The issue reference and attribute pattern matches the established convention in these test files. The consolidated issue #126456 covers all localhost subdomain failures on mobile platforms, making it the appropriate tracking reference.

✅ Scope — Appropriately focused

Only the two affected tests are skipped; no unrelated changes are included. The commit message includes the failing build link, work item, and Helix job for traceability.

💡 Observation — Related test uses different issue

The sibling test DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily (line 253) still references issue #124751 rather than #126456. This is a pre-existing inconsistency and out of scope for this PR, but could be consolidated in a follow-up.

Generated by Code Review for issue #127742 ·

@kotlarmilos kotlarmilos merged commit 578b4d2 into main May 5, 2026
88 of 90 checks passed
@kotlarmilos kotlarmilos deleted the mobile-fix-android-localhost-subdomain-45341ff49b7b78a5 branch May 5, 2026 10:12
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.

DNS localhost subdomain tests with AddressFamily fail on Android

3 participants