-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Process.WaitForExit - COMException: The handle is invalid. #67231
Comments
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process Issue DetailsOn vstest, we updated our logic to give some time to the process to exit (see thread #65377). And we are now seeing random failure on CI (or locally) originating from runtime. I am not sure if this is a bug or a misuse on our side and I haven't been able to create a reproducer that would always fail. CI log:
The
|
The exception gets thrown when calling |
As an aside, it's unfortunate we throw ComException for something as general as E_HANDLE. It reminds me of #26227, but in that case the exception type is consistent across platforms and reasonable only on Windows, and in this case it's not reasonable on Windows plus it's (I guess?) not consistent across platforms. ComException is something of a catch-all in CoreCLR runtime/src/coreclr/vm/clrex.h Line 241 in 4019e83
|
@tmds @danmoseley Thank you for the prompt replies. I will look into whether or not the process was already disposed and I will add the |
This issue has been marked |
This issue has been automatically marked |
Looks like we cannot really tell if it was disposed in our context so I have added a try/catch and it seems to be fine for now. |
On vstest, we updated our logic to give some time to the process to exit (see thread #65377). And we are now seeing random failure on CI (or locally) originating from runtime.
I am not sure if this is a bug or a misuse on our side and I haven't been able to create a reproducer that would always fail.
CI log:
Local error:
The
ProcessHelper
type can be found here: https://github.com/microsoft/vstest/blob/main/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs#L83-L118.The text was updated successfully, but these errors were encountered: