Skip to content
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 tests do not return for 5 minutes #44537

Closed
danmoseley opened this issue Nov 11, 2020 · 2 comments · Fixed by #44571
Closed

Process tests do not return for 5 minutes #44537

danmoseley opened this issue Nov 11, 2020 · 2 comments · Fixed by #44571

Comments

@danmoseley
Copy link
Member

danmoseley commented Nov 11, 2020

If you run the System.Diagnostics.Process tests locally on Windows, after the tests themselves complete there will be a 5 minute delay before dotnet build /t:test returns. this happens after this point:

  === TEST EXECUTION SUMMARY ===
     System.Diagnostics.Process.Tests  Total: 302, Errors: 0, Failed: 0, Skipped: 1, Time: 52.678s
  ----- end Wed 11/11/2020 10:12:30.44 ----- exit code 0 ----------------------------------------------------------

This is because MSBuild is waiting on the spawned cmd process that runs xunit, and that is waiting on two test processes that the tests created but did not terminate. Both of those were clearly created with CreateProcessLong() because they are doing a 5 minute sleep. Such processes are intended to be terminated by tests. It needs to be figured out which test isn't terminating them. I looked through the code and didn't see the issue; bisection may help.

After fixing that, there is another delay, this one in the WaitAsyncForProcess() test: it creates a process that sleeps for 30 seconds, and waits for it to exit. Probably instead the child process should wait to exit on some event set by the parent after the parent has called WaitForExitAsync(). Note this test is outerloop.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Diagnostics.Process untriaged New issue has not been triaged by the area owner labels Nov 11, 2020
@ghost
Copy link

ghost commented Nov 11, 2020

Tagging subscribers to this area: @eiriktsarpalis, @jeffhandley
See info in area-owners.md if you want to be subscribed.


Issue meta data

Issue content: If you run the System.Diagnostics.Process tests locally on Windows, after the tests themselves complete there will be a 5 minute delay before `dotnet build /t:test` returns. this happens after this point: ``` === TEST EXECUTION SUMMARY === System.Diagnostics.Process.Tests Total: 302, Errors: 0, Failed: 0, Skipped: 1, Time: 52.678s ----- end Wed 11/11/2020 10:12:30.44 ----- exit code 0 ---------------------------------------------------------- ``` This is because MSBuild is waiting on the spawned cmd process that runs xunit, and that is waiting on two test processes that the tests created but did not terminate. Both of those were clearly reated with `CreateProcessLong()` because they are doing a 5 minute sleep. Such processes are intended to be terminated by tests. It needs to be figured out which test isn't terminating them.

After fixing that, there is another delay, this one in the WaitAsyncForProcess() test: it creates a process that sleeps for 30 seconds, and waits for it to exit. Probably instead the child process should wait to exit on some event set by the parent after the parent has called WaitForExitAsync(). Note this test is outerloop.

Issue author: danmosemsft
Assignees: -
Milestone: -

@danmoseley
Copy link
Member Author

Noted in #44392. This isn't an urgent issue, but it presumably ties up the test machines for 5 minutes longer than necessary.

@adamsitnik adamsitnik removed the untriaged New issue has not been triaged by the area owner label Nov 12, 2020
@adamsitnik adamsitnik added this to the 6.0.0 milestone Nov 12, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants