From 06f86cd6430da9eeab875da06e2ff22d43a184ad Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Wed, 12 Aug 2020 10:41:54 -0700 Subject: [PATCH] Do not run hostname tests on macOS - ports 522088b6be to this branch --- .../TransportTestHelpers/HostNameIsReachableAttribute.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Servers/Kestrel/shared/test/TransportTestHelpers/HostNameIsReachableAttribute.cs b/src/Servers/Kestrel/shared/test/TransportTestHelpers/HostNameIsReachableAttribute.cs index 5a83bd7c3f88..72415db043fb 100644 --- a/src/Servers/Kestrel/shared/test/TransportTestHelpers/HostNameIsReachableAttribute.cs +++ b/src/Servers/Kestrel/shared/test/TransportTestHelpers/HostNameIsReachableAttribute.cs @@ -4,6 +4,7 @@ using System; using System.Net; using System.Net.Sockets; +using System.Runtime.InteropServices; using System.Threading.Tasks; using Microsoft.AspNetCore.Testing.xunit; @@ -30,6 +31,12 @@ public bool IsMet private async Task HostNameIsReachable() { + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + // Code below is unreliable on macOS and tests fail on that platform. + return false; + } + try { _hostname = Dns.GetHostName();