Skip to content

async read/writes to STD IN/OUT/ERR are cancelable on Windows since .NET 8 - #121960

Merged
adamsitnik merged 1 commit into
dotnet:mainfrom
adamsitnik:processOutputReadsCanBeCancelledNow
Nov 25, 2025
Merged

adamsitnik merged 1 commit into
dotnet:mainfrom
adamsitnik:processOutputReadsCanBeCancelledNow

Conversation

@adamsitnik

@adamsitnik adamsitnik commented Nov 25, 2025 •

Copy link
Copy Markdown
Member

.NET included 8 #87103, the cancellation should just work now.

Context: I am researching Process API issues and found this old test to be running only on Linux.

.\dotnet.cmd build .\src\libraries\System.Diagnostics.Process\tests\System.Diagnostics.Process.Tests.csproj /t:Test /p:xunitMethodName=System.Diagnostics.Tests.ProcessStreamReadTests.ReadAsync_OutputStreams_Cancel_RespondsQuickly
  "D:\projects\runtime\artifacts\bin\testhost\net10.0-windows-Debug-x64\dotnet.exe" exec --runtimeconfig System.Diagnostics.Process.Tests.runtimeconfig.json --depsfile System.Diagnostics.Process.Tests.deps.json C:\Users\adsitnik\.nuget\packages\microsoft.dotnet.xunitconsolerunner\2.9.3-beta.25528.108\build\..\tools\net\xunit.console.dll System.Diagnostics.Process.Tests.dll -xml testResults.xml -nologo -method System.Diagnostics.Tests.ProcessStreamReadTests.ReadAsync_OutputStreams_Cancel_RespondsQuickly -notrait category=OuterLoop -notrait category=failing
  popd
  ===========================================================================================================
    Discovering: System.Diagnostics.Process.Tests (method display = ClassAndMethod, method display options = None)
    Discovered:  System.Diagnostics.Process.Tests (found 1 of 292 test case)
    Starting:    System.Diagnostics.Process.Tests (parallel test collections = on [24 threads], stop on fail = off)
    Finished:    System.Diagnostics.Process.Tests
  === TEST EXECUTION SUMMARY ===
     System.Diagnostics.Process.Tests  Total: 1, Errors: 0, Failed: 0, Skipped: 0, Time: 0.214s
  ----- end Tue 11/25/2025 17:01:00.26 ----- exit code 0 ----------------------------------------------------------

Build succeeded.
    0 Warning(s)
    0 Error(s)

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

@stephentoub stephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once CI is green

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables a previously Linux-only test to run on Windows, now that .NET 8+ supports cancellation for async read/write operations on standard I/O streams on Windows (implemented in PR #87103).

  • Removes the SkipOnPlatform attribute from ReadAsync_OutputStreams_Cancel_RespondsQuickly test

@adamsitnik
adamsitnik enabled auto-merge (squash) November 25, 2025 16:53
@adamsitnik

Copy link
Copy Markdown
Member Author

/ba-g The cancelled jobs are OSX, this PR re-enables the test on Windows and since all Windows CI legs are green, we should be good to go.

@adamsitnik
adamsitnik merged commit f1e2f89 into dotnet:main Nov 25, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants