Under xUnit v3 hosted by Microsoft Testing Platform in VS 2026 18.5.x's
DevHub-hosted Test Explorer, pressing Stop Test Run does not fire any
cancellation token that the test code or a custom XunitTestFrameworkExecutor
override can observe.
How to reproduce
dotnet build this folder (or open StopRepro.csproj in VS).
- In VS Test Explorer, Run
Token_Should_Fire_When_Test_Explorer_Stop_Is_Pressed.
- After ~5 seconds (you'll see poll heartbeats appearing in the log), press
Stop Test Run in Test Explorer.
- Wait at least 30 seconds. Do not stop VS / close anything else.
- Open the log file:
Observed output (bug)
None of those appears. The log only contains:
… [Executor] RunTestCases token: CanBeCanceled=True, AlreadyCancelled=False
… [Test] TEST STARTED. …
… [Test] TestContext token: CanBeCanceled=True, AlreadyCancelled=False
… [Test] poll #10, IsCancellationRequested=False
… [Test] poll #20, IsCancellationRequested=False
…
… [Test] TIMED OUT after N polls. Token never fired.
[StopRepro.zip](https://github.com/user-attachments/files/28453115/StopRepro.zip)
Under xUnit v3 hosted by Microsoft Testing Platform in VS 2026 18.5.x's
DevHub-hosted Test Explorer, pressing Stop Test Run does not fire any
cancellation token that the test code or a custom
XunitTestFrameworkExecutoroverride can observe.
How to reproduce
dotnet buildthis folder (or openStopRepro.csprojin VS).Token_Should_Fire_When_Test_Explorer_Stop_Is_Pressed.Stop Test Run in Test Explorer.
Observed output (bug)
None of those appears. The log only contains: