Skip to content

Conversation

@kartheekp-ms
Copy link
Contributor

@kartheekp-ms kartheekp-ms commented Oct 26, 2020

Bug

Fixes: NuGet/Client.Engineering#613
Regression: No

Fix

Details: When we run NuGet.CommandLine.Tests, every test in the test suite execute creates a nuget.exe process as shown below. Every nuget.exe process executing test command publishes output and error stream to the parent process so that test can check the result to verify the test status.

image

The way we read output and error stream from a Process while running tests in CommandRunner.Run method doesn't work well when tests are executed in parallel because of following reasons.

Work is in progress to support running test suites in parallel. see this issue for more info. This change is required to execute tests in parallel.

I found this doc and issue extremely helpful while working on this fix.

Testing/Validation

Tests Added: No
Reason for not adding tests: Fixing test utility method.
Validation:

@kartheekp-ms kartheekp-ms requested a review from a team as a code owner October 26, 2020 05:10
bool waitForExit,
int timeOutInMilliseconds = 60000,
Action<StreamWriter> inputAction = null,
bool shareProcessObject = false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found no callers in the entire codebase who is passing this optional parameter. Hence removed it. If there are any concerns from others, I can add it back.

Process p = null;

try
using (p = new Process())
Copy link
Member

Choose a reason for hiding this comment

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

Can you shortly elaborate in more detail how your change helps?

I know you linked the issues and I appreciate that, but I was hoping you could save us some time digging through the linked docs if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated PR description with additional information. Pls let me know your feedback.

Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

Thanks for the link.
Great find!

Consider adding a note on what not just the why in the PR title.

@kartheekp-ms
Copy link
Contributor Author

🔔 @NuGet/nuget-client. Any feedback on this PR is helpful. Waiting for second approval.

Copy link
Member

@zivkan zivkan left a comment

Choose a reason for hiding this comment

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

Great find!

@kartheekp-ms kartheekp-ms merged commit 2544eee into dev Nov 4, 2020
@kartheekp-ms kartheekp-ms deleted the dev-kartheekp-ms-commandrunner branch November 4, 2020 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants