You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System.Diagnostics.Tests.ProcessTests.TestToString_OnExitedProcess failing in the CI #56649
Before calling ToString() the test calls WaitForExit(), which it asserted returned true. WaitForExit() is implemented by getting the process handle and waiting for it to be signaled.
Inside ToString(), the code calls ProcessManager.GetProcessInfo(..) --> NtProcessInfoHelper.GetProcessInfos(processId) --> NtQuerySystemInformation passing SystemProcessInformation (0x05) which returns an array of SYSTEM_PROCESS_INFORMATION. If the PID is in that array, it uses the process name (from ImageName in the struct) to append to the result.
This failure suggests that despite the process handle being signaled, NtQuerySystemInformation returned it. We know this is flaky, since it passed when we committed this test.
In the absence of better ideas, short of a sleep, we should modify the test to accept either output since it really doesn't matter much.
Activity
danmoseley commentedon Jul 30, 2021
Before calling ToString() the test calls WaitForExit(), which it asserted returned true. WaitForExit() is implemented by getting the process handle and waiting for it to be signaled.
Inside ToString(), the code calls ProcessManager.GetProcessInfo(..) --> NtProcessInfoHelper.GetProcessInfos(processId) --> NtQuerySystemInformation passing SystemProcessInformation (0x05) which returns an array of SYSTEM_PROCESS_INFORMATION. If the PID is in that array, it uses the process name (from ImageName in the struct) to append to the result.
This failure suggests that despite the process handle being signaled, NtQuerySystemInformation returned it. We know this is flaky, since it passed when we committed this test.
In the absence of better ideas, short of a sleep, we should modify the test to accept either output since it really doesn't matter much.