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

Enables the hanging test #34911

Merged
merged 1 commit into from
Apr 13, 2020
Merged

Enables the hanging test #34911

merged 1 commit into from
Apr 13, 2020

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Apr 13, 2020

FIxes #34801

The hang doesnot reproduce using a clean build. It sometimes repro when a service gets hanged or not started properly or named pipe drops the byte.

I verified the required behavior using a debugview independently and serviceController start behaves as expected.

The order of connected and start bytes is also a strict one i.e. connected is always before start.

C:\git\runtime>dotnet msbuild src\libraries\System.ServiceProcess.ServiceController\tests /t:rebuild;test /p:RuntimeConfiguration=release /p:Outerloop=true /p:XunitmethodName=System.ServiceProcess.Tests.ServiceBaseTests.TestOnStartWithArgsThenStop

  ===========================================================================================================
    Discovering: System.ServiceProcess.ServiceController.Tests (method display = ClassAndMethod, method display options = None)
    Discovered:  System.ServiceProcess.ServiceController.Tests (found 1 of 37 test case)
    Starting:    System.ServiceProcess.ServiceController.Tests (parallel test collections = on, max threads = 12)
    Finished:    System.ServiceProcess.ServiceController.Tests
  === TEST EXECUTION SUMMARY ===
     System.ServiceProcess.ServiceController.Tests  Total: 1, Errors: 0, Failed: 0, Skipped: 0, Time: 4.278s
  ----- end Mon 04/13/2020 11:33:11.39 ----- exit code 0 ----------------------------------------------------------

@Anipik
Copy link
Contributor Author

Anipik commented Apr 13, 2020

  pushd C:\git\runtime\artifacts\bin\System.ServiceProcess.ServiceController.Tests\netcoreapp5.0-Windows_NT-Debug\
  "C:\git\runtime\artifacts\bin\testhost\netcoreapp5.0-Windows_NT-Debug-x64\dotnet.exe" exec --runtimeconfig System.ServiceProcess.ServiceController.Tests.runtimeconfig.json --depsfile System.ServiceProcess.ServiceController.Tests.deps.json xunit.console.dll System.ServiceProcess.ServiceController.Tests.dll -xml testResults.xml -nologo -notrait category=failing -notrait category=nonnetcoreapptests -notrait category=nonwindowstests
  popd
  ===========================================================================================================
    Discovering: System.ServiceProcess.ServiceController.Tests (method display = ClassAndMethod, method display options = None)
    Discovered:  System.ServiceProcess.ServiceController.Tests (found 36 of 37 test cases)
    Starting:    System.ServiceProcess.ServiceController.Tests (parallel test collections = on, max threads = 12)
    Finished:    System.ServiceProcess.ServiceController.Tests
  === TEST EXECUTION SUMMARY ===
     System.ServiceProcess.ServiceController.Tests  Total: 39, Errors: 0, Failed: 0, Skipped: 0, Time: 40.316s
  ----- end Mon 04/13/2020 11:40:38.21 ----- exit code 0 ----------------------------------------------------------

@danmoseley
Copy link
Member

This doesn't make the test pass in any circumstances where it would previously hang, right? It just makes it log which of the 2 packets was never received. Which is fine but I dont' think it would fix any hang?

@Anipik
Copy link
Contributor Author

Anipik commented Apr 13, 2020

Which is fine but I dont' think it would fix any hang

Yes but it seems like hangs were not occurring due to this particular test but more of like test service taking a long time to start due to not able to get hold of the executable path or for some other machine related reasons. This test hits this because we start the service from the same executable path multiple times.
Some of these instances were not getting cleaned properly when i stopped the hanging.

But u r right, hangs are infrequent but still occur once in a while

@Anipik
Copy link
Contributor Author

Anipik commented Apr 13, 2020

It just makes it log which of the 2 packets was never received

packets are getting received. earlier the packets could be out of order. Now they will be in order i.e connected first followed by start packet

@Anipik Anipik merged commit 762e825 into dotnet:master Apr 13, 2020
@Anipik Anipik deleted the hang branch April 13, 2020 22:34
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestOnStartWithArgsThenStop Times out
3 participants