Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 19b3eff

Browse files
author
Paulo Janotti
authored
Ignore ping6 failures on macOS 10.12 (#27349)
Fixes #26358
1 parent dacff1f commit 19b3eff

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,18 @@ public static async Task PacketSizeIsRespected(int payloadSize)
5353
p.BeginOutputReadLine();
5454
p.BeginErrorReadLine();
5555

56+
// There are multiple issues with ping6 in macOS 10.12 (Sierra), see https://github.com/dotnet/corefx/issues/26358.
57+
bool isPing6OnMacSierra = utilityPath.Equals(UnixCommandLinePing.Ping6UtilityPath) &&
58+
RuntimeInformation.IsOSPlatform(OSPlatform.OSX) &&
59+
!PlatformDetection.IsMacOsHighSierraOrHigher;
60+
5661
string pingOutput;
5762
if (!p.WaitForExit(TestSettings.PingTimeout))
5863
{
64+
// Workaround known issues with ping6 in macOS 10.12
65+
if (isPing6OnMacSierra)
66+
return;
67+
5968
pingOutput = string.Join("\n", stdOutLines);
6069
string stdErr = string.Join("\n", stdErrLines);
6170
throw new Exception(
@@ -69,6 +78,10 @@ public static async Task PacketSizeIsRespected(int payloadSize)
6978
var exitCode = p.ExitCode;
7079
if (exitCode != 0)
7180
{
81+
// Workaround known issues with ping6 in macOS 10.12
82+
if (isPing6OnMacSierra)
83+
return;
84+
7285
string stdErr = string.Join("\n", stdErrLines);
7386
throw new Exception(
7487
$"[{utilityPath} {arguments}] process exit code is {exitCode}.\nStdOut:[{pingOutput}]\nStdErr:[{stdErr}]");

0 commit comments

Comments
 (0)