Skip to content

System.Diagnostics.Tests.ProcessTests.TestToString_OnExitedProcess failing in the CI #56649

Closed

Description

@tarekgh

https://dev.azure.com/dnceng/public/_build/results?buildId=1268768&view=logs&j=1422aa79-6880-5d83-e13f-65c73e5c446b&t=f314303b-c6ab-51e8-2c96-4cbe16c1a0a2

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-56504-merge-b7005c257cb84dc688/System.Diagnostics.Process.Tests/console.0ad0143c.log?sv=2019-07-07&se=2021-08-19T22%3A06%3A57Z&sr=c&sp=rl&sig=2CWyX9R8Vs5TyDW7fMIet3VfEWnMAX6eeyqKDZ6tsB4%3D

C:\h\w\A9F70974\w\A2CA08DC\e>"C:\h\w\A9F70974\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.Process.Tests.runtimeconfig.json --depsfile System.Diagnostics.Process.Tests.deps.json xunit.console.dll System.Diagnostics.Process.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Diagnostics.Process.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Diagnostics.Process.Tests (found 254 of 278 test cases)
  Starting:    System.Diagnostics.Process.Tests (parallel test collections = on, max threads = 2)
    System.Diagnostics.Tests.ProcessStartInfoTests.ShellExecute_Nano_Fails_Start [SKIP]
      Condition(s) not met: "IsWindowsNanoServer"
    System.Diagnostics.Tests.ProcessTests.TestToString_OnExitedProcess [FAIL]
      Assert.Equal() Failure
                                       ? (pos 26)
      Expected: ....Diagnostics.Process
      Actual:   ....Diagnostics.Process (dotnet)
                                       ? (pos 26)
      Stack Trace:
        /_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs(492,0): at System.Diagnostics.Tests.ProcessTests.TestToString_OnExitedProcess()
Invalid number of parameters

Activity

  1. danmoseley commented on Jul 30, 2021

    @danmoseley
    Contributor

    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.

  2. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 30, 2021
  3. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 31, 2021
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 2, 2021
  5. added this to the 6.0.0 milestone on Aug 2, 2021
  6. ghost locked as resolved and limited conversation to collaborators on Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions