dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.47k stars 4.76k forks source link

Test failure System.Management.Tests.ManagementObjectTests.Invoke_Instance_And_Static_Method_Win32_Process #70414

Open VincentBu opened 2 years ago

VincentBu commented 2 years ago

Run: runtime-libraries-coreclr outerloop 20220607.3

Failed test:

net48-windows-Release-x64-Windows.11.Amd64.Client.Open

- System.Management.Tests.ManagementObjectTests.Invoke_Instance_And_Static_Method_Win32_Process

Error message:

System.AggregateException : One or more errors occurred.
---- Assert.Equal() Failure
Expected: 0
Actual:   21
---- Assert.Equal() Failure
Expected: 0
Actual:   8
---- Assert.Equal() Failure
Expected: 0
Actual:   8
---- Assert.Equal() Failure
Expected: 0
Actual:   21
---- Assert.Equal() Failure
Expected: 0
Actual:   8
---- Assert.Equal() Failure
Expected: 0
Actual:   8
---- Assert.Equal() Failure
Expected: 0
Actual:   21
---- Assert.Equal() Failure
Expected: 0
Actual:   8
---- Assert.Equal() Failure
Expected: 0
Actual:   8
---- Assert.Equal() Failure
Expected: 0
Actual:   21

Stack trace
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 54
   at System.Management.Tests.ManagementObjectTests.Invoke_Instance_And_Static_Method_Win32_Process() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 95
----- Inner Stack Trace #1 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #2 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #3 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #4 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #5 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #6 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #7 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45
----- Inner Stack Trace #8 (Xunit.Sdk.EqualException) -----
   at System.Management.Tests.ManagementObjectTests.<>c.<Invoke_Instance_And_Static_Method_Win32_Process>b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80
   at System.RetryHelper.Execute(Ac
ghost commented 2 years ago

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

Issue Details
Run: [runtime-libraries-coreclr outerloop 20220607.3](https://dev.azure.com/dnceng/public/_build/results?buildId=1810764&view=ms.vss-test-web.build-test-results-tab&runId=48147924&resultId=100054&paneView=debug) Failed test: ``` net48-windows-Release-x64-Windows.11.Amd64.Client.Open - System.Management.Tests.ManagementObjectTests.Invoke_Instance_And_Static_Method_Win32_Process ``` **Error message:** ``` System.AggregateException : One or more errors occurred. ---- Assert.Equal() Failure Expected: 0 Actual: 21 ---- Assert.Equal() Failure Expected: 0 Actual: 8 ---- Assert.Equal() Failure Expected: 0 Actual: 8 ---- Assert.Equal() Failure Expected: 0 Actual: 21 ---- Assert.Equal() Failure Expected: 0 Actual: 8 ---- Assert.Equal() Failure Expected: 0 Actual: 8 ---- Assert.Equal() Failure Expected: 0 Actual: 21 ---- Assert.Equal() Failure Expected: 0 Actual: 8 ---- Assert.Equal() Failure Expected: 0 Actual: 8 ---- Assert.Equal() Failure Expected: 0 Actual: 21 Stack trace at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 54 at System.Management.Tests.ManagementObjectTests.Invoke_Instance_And_Static_Method_Win32_Process() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 95 ----- Inner Stack Trace #1 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #2 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #3 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #4 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #5 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #6 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #7 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Action test, Int32 maxAttempts, Func`2 backoffFunc, Predicate`1 retryWhen, String testName) in /_/src/libraries/Common/tests/TestUtilities/System/RetryHelper.cs:line 45 ----- Inner Stack Trace #8 (Xunit.Sdk.EqualException) ----- at System.Management.Tests.ManagementObjectTests.<>c.b__4_0() in /_/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs:line 80 at System.RetryHelper.Execute(Ac ```
Author: VincentBu
Assignees: -
Labels: `area-System.Management`, `os-windows`, `arch-x64`, `blocking-outerloop`
Milestone: -
ViktorHofer commented 2 years ago

Another retry that apparently doesn't work. @smasher164 do you want to take a look at this one as well?

danmoseley commented 2 years ago
C:\git\runtime>net helpmsg 8
Not enough memory resources are available to process this command.

C:\git\runtime>net helpmsg 21
The device is not ready.

The test notes these are why it retries https://github.com/dotnet/runtime/blob/92fa9591d07cf4bf998086e1edd54e9a38f7435c/src/libraries/System.Management/tests/System/Management/ManagementObjectTests.cs#L69

My guess is that more retries won't help. If it's "this process just got into a bad state" then, wrapping RemoteExecutor.Invoke with retries might help.

Or, just disable this test for Windows 11. It passes elsewhere:

TestResults
| join kind=inner WorkItems on WorkItemId
| join kind=inner Jobs on JobId
| where Finished >= now(-30d)
| where Result == "Pass" or Message contains "Assert.Equal"
| where Method == "Invoke_Instance_And_Static_Method_Win32_Process"
| project 
  Pipeline = tostring(parse_json(Properties).DefinitionName),
  Pipeline_Configuration = tostring(parse_json(Properties).configuration),
  OS = QueueName,
  Arch = tostring(parse_json(Properties).architecture),
  Test = Type1,
  Result,
  Finished,
 // Duration,
  //Method,
 // Build = tostring(parse_json(Properties).BuildNumber)
  Message
  | summarize count() by OS, Result//, Message//, Method
OS Result count_
windows.10.amd64.serverrs5.open.svc Pass 114
windows.amd64.server2022.open.svc Pass 114
windows.81.amd64.open.svc Pass 58
windows.7.amd64.open.svc Pass 56
windows.10.amd64.client21h1.open.svc Pass 115
windows.11.amd64.client.open.rt Fail 1
windows.11.amd64.clientpre.open.svc Fail 4
windows.7.amd64 Pass 2
windows.10.amd64.core Pass 2
windows.10.amd64 Pass 2
windows.81.amd64 Pass 2
windows.11.amd64.clientpre.open Fail 3
danmoseley commented 2 years ago

@smasher164 as you disabled the test, we remove blocking label.

danmoseley commented 2 years ago

Moving to Future as it is no longer failing (now Win11 disabled)