-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Hi!
I am investigating an issue on vstest and I have nailed down the issue to the fact we receive the exit callback before we have flushed all the output/error messages.
Looking here, I have found the issue When Process.WaitForExitCore(int milliseconds) waits successfully, the redirected output streams miss some data which seems to solve our problem.
But, I am not sure which of the discussed solution is the one to rely apply (i.e. WaitForExitAsync, multi calls to WaitForExit, or read until null). The various solutions seem to work but I guess there is one solution to favor and it's not clear what/why.
I think that I simply need to replace the call to p.WaitForExit(500) by an awaited call to WaitForExitAsync with a cancellation token that times out.
Thank you for your feedback/answer.