Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for System.Diagnostics.Process.Responding #46142

Merged
merged 9 commits into from
Dec 21, 2020

Conversation

adamsitnik
Copy link
Member

@eiriktsarpalis testing Process.Responding using a real unresponsive process would be very hard (or even close to impossible) to do properly

I think that we just test the implementation to ensure that #36768 is not coming back

My motivation is that the implementation just checks if a boolean flag is set and calls WinAPI:

https://github.com/JeroenOortwijn/runtime/blob/c4d3ed52ed8c3763ab69dbc53376eca77e02abd4/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs#L275-L302

Fixes #40703

@adamsitnik adamsitnik added this to the 6.0.0 milestone Dec 16, 2020
@ghost
Copy link

ghost commented Dec 16, 2020

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

@eiriktsarpalis testing Process.Responding using a real unresponsive process would be very hard (or even close to impossible) to do properly

I think that we just test the implementation to ensure that #36768 is not coming back

My motivation is that the implementation just checks if a boolean flag is set and calls WinAPI:

https://github.com/JeroenOortwijn/runtime/blob/c4d3ed52ed8c3763ab69dbc53376eca77e02abd4/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs#L275-L302

Fixes #40703

Author: adamsitnik
Assignees: -
Labels:

area-System.Diagnostics.Process, test enhancement

Milestone: 6.0.0

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Assert.True(process.Responding); // sets haveResponding to true
Assert.True(GetHaveResponding(process));

process.Refresh(); // sets haveResponding to false
Copy link
Member

Choose a reason for hiding this comment

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

Given we're going down that route, wouldn't it make more sense to just make sure Refresh() invalidates all the right caches?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean testing other fields as well? It's a good idea, I'll do that

Copy link
Member

Choose a reason for hiding this comment

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

Yep, and perhaps renaming the test to something like Refresh_Invalidates_All_Caches (or something like that).

Copy link
Member Author

Choose a reason for hiding this comment

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

@eiriktsarpalis I've decided to give up on this idea for two reasons:

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik adamsitnik merged commit 1e2685b into dotnet:master Dec 21, 2020
@adamsitnik adamsitnik deleted the 40703 branch December 21, 2020 20:45
@ghost ghost locked as resolved and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for System.Diagnostics.Process.Responding
3 participants