Skip to content

Document Process timing properties after exit#130794

Merged
adamsitnik merged 9 commits into
mainfrom
copilot/create-process-test
Jul 17, 2026
Merged

Document Process timing properties after exit#130794
adamsitnik merged 9 commits into
mainfrom
copilot/create-process-test

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Process timing information remains available after exit on Windows, while Unix discards uncached information when reaping the process.

Changes

  • Add cross-platform coverage for StartTime, ExitTime, and processor-time properties after immediate process exit.
  • Verify unavailable Unix timing properties consistently throw InvalidOperationException.
  • Document Windows handle retention and Unix StartTime caching behavior in XML documentation.

fixes #125741

Copilot AI and others added 3 commits July 15, 2026 15:39
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@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.

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 adds test coverage and XML documentation clarifying how System.Diagnostics.Process timing properties behave after a process exits, highlighting cross-platform differences (Windows retains timing data via process handles; Unix may lose uncached timing data after reaping).

Changes:

  • Adds a new cross-platform test validating StartTime, ExitTime, and processor-time properties after an immediate process exit.
  • Updates XML docs to describe post-exit availability for processor-time properties on Windows vs Unix.
  • Updates Process.StartTime and Process.ExitTime XML docs to document caching/exception behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs Adds a new test exercising timing properties after process exit across Windows/Unix.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs Documents StartTime caching behavior and ExitTime summary/exception behavior.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs Documents that processor-time properties remain retrievable after exit on Windows.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs Documents that processor-time properties are unavailable after exit on Linux.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.OSX.cs Documents that processor-time properties are unavailable after exit on macOS.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.FreeBSD.cs Documents that processor-time properties are unavailable after exit on FreeBSD.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.OpenBSD.cs Documents that processor-time properties are unavailable after exit on OpenBSD.
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.SunOS.cs Documents that processor-time properties are unavailable after exit on SunOS.

Comment thread src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs Outdated
Comment thread src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs

@adamsitnik adamsitnik 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.

@copilot please address the feedback

Comment thread src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs Outdated
Comment thread src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 15, 2026 16:18
Copilot AI requested a review from adamsitnik July 15, 2026 16:19
@adamsitnik
adamsitnik marked this pull request as ready for review July 15, 2026 16:22
Copilot AI review requested due to automatic review settings July 15, 2026 16:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@adamsitnik adamsitnik 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

Copilot AI temporarily deployed to copilot-pat-pool July 16, 2026 17:42 Inactive
@adamsitnik
adamsitnik requested a review from jkotas July 16, 2026 17:42
Copilot AI temporarily deployed to copilot-pat-pool July 16, 2026 17:42 Inactive
Comment thread src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs Outdated

@tannergooding tannergooding 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, but I agree that Jan's feedback on terminology should be addressed

Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot AI requested review from adamsitnik and Copilot and removed request for Copilot July 17, 2026 09:35
Copilot AI temporarily deployed to copilot-pat-pool July 17, 2026 09:45 Inactive
Copilot AI temporarily deployed to copilot-pat-pool July 17, 2026 09:45 Inactive
@adamsitnik
adamsitnik enabled auto-merge (squash) July 17, 2026 09:46
@adamsitnik
adamsitnik requested a review from jkotas July 17, 2026 09:46
@jkotas

jkotas commented Jul 18, 2026

Copy link
Copy Markdown
Member

@adamsitnik Don't forget about the backport to https://github.com/dotnet/dotnet-api-docs/ . It won't happen automatically. Asking copilot to create the backport PR works great.

@adamsitnik

Copy link
Copy Markdown
Member

@adamsitnik Don't forget about the backport to https://github.com/dotnet/dotnet-api-docs/ . It won't happen automatically. Asking copilot to create the backport PR works great.

Thanks for the reminder, I assumed somebody owns this process. I've opened dotnet/dotnet-api-docs#12887 and foremost dotnet/dotnet-api-docs#12888 to backport all the docs for new APIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Process properties throw Win32Exceptions instead of documented InvalidOperationException

5 participants