Relax localhost subdomain address-family checks on Android/AppleMobile#128404
Relax localhost subdomain address-family checks on Android/AppleMobile#128404Copilot wants to merge 2 commits into
Conversation
…roid/AppleMobile Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Adjusts System.Net.NameResolution functional test expectations for Dns.GetHostEntry(..., AddressFamily) on Android/Apple mobile where the OS resolver can return mixed-family results, reducing platform-specific flakiness while keeping stricter validation on other platforms.
Changes:
- Adds platform gating (
strictAddressFamily) to relax address-family assertions on Android/Apple mobile. - Factors shared sync/async validation into a local
VerifyAddressFamilyhelper. - Replaces per-element
Assert.All(always) with “requested family must be present” (Assert.Contains) plus conditional strict validation.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs | Relaxes address-family assertions on Android/Apple mobile and refactors the sync/async checks into a helper. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
| Assert.Contains(entry.AddressList, addr => addr.AddressFamily == addressFamily); | ||
| if (strictAddressFamily) | ||
| { | ||
| Assert.All(entry.AddressList, addr => Assert.Equal(addressFamily, addr.AddressFamily)); | ||
| } |
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
|
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot There is a similar failure for DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily, can you address this one as well? |
Addressed in 27909d9. I applied the same Android/AppleMobile relaxation to |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
main PR
Description
This PR relaxes
AddressFamilyassertions for*.localhostDNS functional tests on Android and Apple mobile, where OS resolvers can return mixed-family results (for example, link-local IPv6 entries during IPv4 queries), causing flakes.It now applies the same platform-specific behavior to both:
DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamilyDnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamilyOn Android/Apple mobile, tests require the requested family to be represented where applicable and skip strict per-entry family enforcement. On other platforms, strict family validation is preserved.
Customer Impact
Reduces CI/test flakiness on mobile platforms and improves reliability of runtime-extra-platforms validation without changing product behavior.
Regression
No product regression fix; this is a test expectation adjustment for platform-specific resolver behavior.
Testing
DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamilyDnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamilyRisk
Low risk. Changes are limited to test code in
System.Net.NameResolutionfunctional tests and only relax assertions on Android/Apple mobile while keeping strict validation elsewhere.Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.