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.
There are cases where we are failing to look at the entire result of a ProcessExtensions call because we return our result as soon as
process.Exited
is Invoked. Butprocess.Exited
does not indicate that all the STDOUT and STDERR events have been handled, only that the process has entered the Exited state. So I took a look at what they do in dotnet/format and made some changes. Of particular note here is the call toWaitForExit
which guarantees that all events currently in-flight returns before returning.This could express itself in a lot of ways, but what I observed was that not all transitive dependencies of a project were being correctly reported (we shell that work out to MSBuild). I was unable to write a unit-test which replicated that behavior (unsurprising since it's technically a timing issue), but did find that my changes fixed local runs which were exhibiting this behavior. If anyone can come up with a Unit Test of
ProcessExtensions.RunAsync
which could reliably test this I'm all ear, otherwise I think we'll have to rely on the practical test I did and the fact that we're cribbing off of dotnet/format and roslyn.Huge thanks to @JoeRobich for pairing with me on this one.