Skip to content

Test failure: Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService #107240

Closed

Description

@v-wenyuxu

Failed in: runtime-coreclr libraries-pgo 20240901.1

Failed tests:

net9.0-windows-Release-arm64-defaultpgo-Windows.11.Arm64.Open
    - Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService

Error message:

 System.ServiceProcess.TimeoutException : The operation requested for service 'CanCreateService' has not been completed within the specified time interval.

Stack trace:

   at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) in /_/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs:line 994
   at Microsoft.Extensions.Hosting.WindowsServiceTester.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceTester.cs:line 58
   at Microsoft.Extensions.Hosting.WindowsServiceTester.WaitForStatus(ServiceControllerStatus desiredStatus) in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceTester.cs:line 54
   at Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService() in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/UseWindowsServiceTests.cs:line 47
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57

Activity

  1. added
    untriaged
    on Sep 2, 2024
  2. dotnet-policy-service commented on Sep 2, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-extensions-hosting
    See info in area-owners.md if you want to be subscribed.

  3. v-wenyuxu commented on Sep 3, 2024

    @v-wenyuxu
    Author

    Failed in: runtime-coreclr libraries-jitstress 20240902.1

    Failed tests:

    net9.0-windows-Release-arm64-jitminopts-Windows.11.Arm64.Open
        - Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService
    

    Error message:

     System.ServiceProcess.TimeoutException : The operation requested for service 'CanCreateService' has not been completed within the specified time interval.
    

    Stack trace:

       at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) in /_/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs:line 994
       at Microsoft.Extensions.Hosting.WindowsServiceTester.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceTester.cs:line 58
       at Microsoft.Extensions.Hosting.WindowsServiceTester.WaitForStatus(ServiceControllerStatus desiredStatus) in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceTester.cs:line 54
       at Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService() in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/UseWindowsServiceTests.cs:line 47
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
       at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
    
  4. steveharter commented on Sep 3, 2024

    @steveharter
    Contributor

    Appears to be duplicate of #103548 which was recently fixed in 10.0 and backported to 9.0. That may need to be re-opened.

    The failure above is from 9.0: net9.0-windows-Release-arm64-jitminopts-Windows.11.Arm64.Open

  5. steveharter commented on Sep 3, 2024

    @steveharter
    Contributor
  6. ericstj commented on Sep 3, 2024

    @ericstj
    Member

    Failing in main too - service is not starting after waiting 3 minutes. I'm inclined to believe that something about the environment here is causing the test to fail. I'll see if I can repro locally by pulling down the test payload from these jitminopts runs.

  7. self-assigned this
    on Sep 4, 2024
  8. added this to the 9.0.0 milestone on Sep 4, 2024
  9. ericstj commented on Sep 4, 2024

    @ericstj
    Member

    No repro on x64 - need to have a look on arm64. Could be something with how the service configuration/installation is working there.

  10. removed
    untriaged
    on Sep 4, 2024
  11. ericstj commented on Sep 4, 2024

    @ericstj
    Member

    I tested on an arm64 machine and it works here:

    D:\scratch\serviceRepro\workitems\Microsoft.Extensions.Hosting.WindowsServices.Tests>"D:\scratch\serviceRepro\.\correlation-payload\dotnet.exe" exec --runtimeconfig Microsoft.Extensions.Hosting.WindowsServices.Tests.runtimeconfig.json --depsfile Microsoft.Extensions.Hosting.WindowsServices.Tests.deps.json xunit.console.dll Microsoft.Extensions.Hosting.WindowsServices.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
      Discovering: Microsoft.Extensions.Hosting.WindowsServices.Tests (method display = ClassAndMethod, method display options = None)
      Discovered:  Microsoft.Extensions.Hosting.WindowsServices.Tests (found 12 test cases)
      Starting:    Microsoft.Extensions.Hosting.WindowsServices.Tests (parallel test collections = on [8 threads], stop on fail = off)
      Finished:    Microsoft.Extensions.Hosting.WindowsServices.Tests
    === TEST EXECUTION SUMMARY ===
       Microsoft.Extensions.Hosting.WindowsServices.Tests  Total: 12, Errors: 0, Failed: 0, Skipped: 0, Time: 10.625s
    

    I used the exact same test payload from the failing machine. I'm now running in a loop to determine if there's a timing issue at play. I don't really see how that could happen here though - it's waiting for the service to start so even if the service started early or late - it should still sync up. My best guess is that the service is failing to start in a way that's missed by the SCM API. If I cannot reproduce it we can add some more diagnostics here in hopes we can gather more info in case of a failure.

  12. v-wenyuxu commented on Sep 6, 2024

    @v-wenyuxu
    Author

    Failed in: runtime-coreclr libraries-jitstress-random 20240904.1

    Failed tests:

    net9.0-windows-Release-arm64-jitstress_random_2-Windows.11.Arm64.Open
        - Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService
    

    Error message:

     System.ServiceProcess.TimeoutException : The operation requested for service 'CanCreateService' has not been completed within the specified time interval.
    

    Stack trace:

       at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) in /_/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs:line 994
       at Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService() in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/UseWindowsServiceTests.cs:line 47
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
       at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
    
  13. v-wenyuxu commented on Sep 9, 2024

    @v-wenyuxu
    Author

    Failed in: runtime-coreclr libraries-jitstressregs 20240908.1

    Failed tests:

    net9.0-windows-Release-arm64-jitstressregs2-Windows.11.Arm64.Open
        - Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService
    

    Error message:

     System.ServiceProcess.TimeoutException : The operation requested for service 'CanCreateService' has not been completed within the specified time interval.
    

    Stack trace:

       at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) in /_/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs:line 994
       at Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanCreateService() in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/UseWindowsServiceTests.cs:line 47
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
       at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
    
  14. mikelle-rogers commented on Sep 9, 2024

    @mikelle-rogers
    Member

    @ericstj, thanks for continuing to look into the test failure!

  15. ericstj commented on Sep 12, 2024

    @ericstj
    Member

    Probably the root cause here is the same as #107671. The process is hanging. Neither the test nor Service nor Extensions libraries are on the stack. I could use help from someone taking a look at the dump who has more SOS-fu than this tired manager. Any takers?

  16. locked and limited conversation to collaborators on Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions