From 76bba5b69e4e480a3745d87fa3edc121fe27ae42 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Thu, 11 Dec 2025 19:50:20 +0000 Subject: [PATCH] fix: update ExternalCancellationTests documentation and add ExcludeOn attribute for Windows --- TUnit.Engine.Tests/ExternalCancellationTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TUnit.Engine.Tests/ExternalCancellationTests.cs b/TUnit.Engine.Tests/ExternalCancellationTests.cs index 88dce62572..ec08ba2f92 100644 --- a/TUnit.Engine.Tests/ExternalCancellationTests.cs +++ b/TUnit.Engine.Tests/ExternalCancellationTests.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using CliWrap; using Shouldly; +using TUnit.Core.Enums; using TUnit.Engine.Tests.Enums; namespace TUnit.Engine.Tests; @@ -10,6 +11,12 @@ namespace TUnit.Engine.Tests; /// These tests start the test process asynchronously, cancel it mid-execution (simulating Ctrl+C or Stop button), /// and verify that After hooks still execute by checking for marker files. /// +/// +/// These tests are skipped on Windows because CliWrap's graceful cancellation uses GenerateConsoleCtrlEvent, +/// which doesn't work reliably for child processes with their own console. +/// See: https://github.com/Tyrrrz/CliWrap/issues/47 +/// +[ExcludeOn(OS.Windows)] public class ExternalCancellationTests(TestMode testMode) : InvokableTestBase(testMode) { private static readonly string TempPath = Path.GetTempPath();