diff --git a/src/Tasks.UnitTests/Exec_Tests.cs b/src/Tasks.UnitTests/Exec_Tests.cs index cd40c443d31..5b8ccf512fa 100644 --- a/src/Tasks.UnitTests/Exec_Tests.cs +++ b/src/Tasks.UnitTests/Exec_Tests.cs @@ -93,8 +93,12 @@ public void ExitCodeCausesFailure() [Fact] public void Timeout() { - // On non-Windows the exit code of a killed process is SIGTERM (143) - int expectedExitCode = NativeMethodsShared.IsWindows ? -1 : 143; + // On non-Windows the exit code of a killed sh should be + // SIGTERM (15) + exited-due-to-signal (128) = 143. + // On .NET Core 2.1 preview2 + High Sierra it's consistently + // just 128 for some reason. + int expectedExitCode = NativeMethodsShared.IsWindows ? -1 : + NativeMethodsShared.IsOSX ? 128 : 143; Exec exec = PrepareExec(NativeMethodsShared.IsWindows ? ":foo \n goto foo" : "while true; do sleep 1; done"); exec.Timeout = 5;