Skip to content

Commit 078512a

Browse files
committed
Alter tests
1 parent 6b17394 commit 078512a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/System.CommandLine.Tests/Invocation/CancelOnProcessTerminationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class CancelOnProcessTerminationTests
2020
private const int SIGTERM = 15;
2121

2222
[LinuxOnlyTheory]
23-
[InlineData(SIGINT, Skip = "https://github.com/dotnet/command-line-api/issues/1206")] // Console.CancelKeyPress
23+
[InlineData(SIGINT/*, Skip = "https://github.com/dotnet/command-line-api/issues/1206"*/)] // Console.CancelKeyPress
2424
[InlineData(SIGTERM)] // AppDomain.CurrentDomain.ProcessExit
2525
public async Task CancelOnProcessTermination_cancels_on_process_termination(int signo)
2626
{
@@ -151,7 +151,7 @@ public async Task CancelOnProcessTermination_timeout_on_cancel_processing(int? t
151151
childState.Should().Be(ChildProcessWaiting);
152152

153153
// Request termination
154-
kill(process.Id, SIGTERM).Should().Be(0);
154+
kill(process.Id, /*SIGTERM*/ SIGINT).Should().Be(0);
155155

156156
// Verify the process terminates timely
157157
bool processExited = process.WaitForExit(10000);

src/System.CommandLine/Builder/CommandLineBuilderExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ public static CommandLineBuilder CancelOnProcessTermination(
101101
{
102102
// Prevent our ProcessExit from intervene and block the exit
103103
AppDomain.CurrentDomain.ProcessExit -= processExitHandler;
104-
context.ExitCode = SIGINT_EXIT_CODE;
105-
ExitCode = SIGINT_EXIT_CODE;
106104
Environment.Exit(SIGINT_EXIT_CODE);
107105
}, (CancellationToken)default);
108106
}

0 commit comments

Comments
 (0)