Add Process.WaitForExit(TimeSpan) polyfill (NET 7.0)#119
Merged
Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/df6507d1-28dd-494f-82e3-aa00de5dc22b Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 17, 2026 10:30
View session
Tyrrrz
reviewed
Apr 17, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prime #119 +/- ##
==========================================
+ Coverage 90.75% 90.81% +0.06%
==========================================
Files 282 284 +2
Lines 4898 4934 +36
Branches 401 404 +3
==========================================
+ Hits 4445 4481 +36
+ Misses 364 363 -1
- Partials 89 90 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a PolyShim polyfill for System.Diagnostics.Process.WaitForExit(TimeSpan) (introduced in .NET 7) so callers can use the TimeSpan overload on older target frameworks, along with tests and signature documentation updates.
Changes:
- Add
Process.WaitForExit(TimeSpan)polyfill (guarded byFEATURE_PROCESSand!NET7_0_OR_GREATER) delegating toWaitForExit(int). - Add
Net70tests intended to cover “exits within timeout” and “timeout elapsed” behaviors. - Update
Signatures.mdto include the new member and adjust totals.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| Signatures.md | Documents the added Process.WaitForExit(TimeSpan) member and updates counts. |
| PolyShim/Net70/Process.cs | Implements the WaitForExit(TimeSpan) polyfill for pre-.NET 7 TFMs. |
| PolyShim.Tests/Net70/ProcessTests.cs | Adds tests for the new TimeSpan overload behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot stopped work on behalf of
Tyrrrz due to an error
April 17, 2026 10:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Process.WaitForExit(TimeSpan timeout)was introduced in .NET 7.0 and is not available on older TFMs. This adds a polyfill so it can be used on .NET Framework, .NET Standard, and pre-7.0 .NET Core targets.Changes
PolyShim/Net70/Process.cs— Extension method polyfill forProcess.WaitForExit(TimeSpan), guarded byFEATURE_PROCESSand!NET7_0_OR_GREATER. Validates theTimeSpanis within the[-1, int.MaxValue]ms range (matching the native API contract), then delegates toWaitForExit(int).PolyShim.Tests/Net70/ProcessTests.cs— Two tests covering the success (process exits within timeout) and timeout-elapsed (returnsfalse) paths.