Do not run hostname tests on macOS

- ports 522088b6be to this branch
This commit is contained in:
Doug Bunting 2020-08-12 10:41:54 -07:00
parent 7fc3da231c
commit 06f86cd643
No known key found for this signature in database
GPG Key ID: EE41520987982C03
1 changed files with 7 additions and 0 deletions

View File

@ -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 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
private async Task<bool> HostNameIsReachable()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// Code below is unreliable on macOS and tests fail on that platform.
return false;
}
try
{
_hostname = Dns.GetHostName();