diff --git a/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs b/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs index 639028b11cfa..21008a3e0376 100644 --- a/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs +++ b/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs @@ -35,7 +35,6 @@ public void TryGetAddrInfo_LocalHost() Assert.NotNull(hostEntry.Aliases); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue(32797)] public void TryGetAddrInfo_HostName() { string hostName = NameResolutionPal.GetHostName(); @@ -50,6 +49,16 @@ public void TryGetAddrInfo_HostName() // machine configurations, which varies by distro and is often inconsistent. return; } + + // Temporary instrumentation for #32797 + if (error == SocketError.TryAgain && Environment.OSVersion.Platform == PlatformID.Unix) + { + error = NameResolutionPal.TryGetAddrInfo(hostName, out hostEntry, out nativeErrorCode); + if (error != SocketError.TryAgain) + { + throw new InvalidOperationException("Name resolution failure preventable with retry"); + } + } Assert.Equal(SocketError.Success, error); Assert.NotNull(hostEntry); @@ -92,7 +101,6 @@ public void TryGetAddrInfo_LocalHost_TryGetNameInfo() Assert.NotNull(name); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue(32797)] public void TryGetAddrInfo_HostName_TryGetNameInfo() { string hostName = NameResolutionPal.GetHostName(); @@ -109,6 +117,16 @@ public void TryGetAddrInfo_HostName_TryGetNameInfo() return; } + // Temporary instrumentation for #32797 + if (error == SocketError.TryAgain && Environment.OSVersion.Platform == PlatformID.Unix) + { + error = NameResolutionPal.TryGetAddrInfo(hostName, out hostEntry, out nativeErrorCode); + if (error != SocketError.TryAgain) + { + throw new InvalidOperationException("Name resolution failure preventable with retry"); + } + } + Assert.Equal(SocketError.Success, error); Assert.NotNull(hostEntry);