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

System.Diagnostics.Tests.PerformanceCounterTests failed in CI #60933

Closed
eerhardt opened this issue Oct 27, 2021 · 9 comments · Fixed by #73170
Closed

System.Diagnostics.Tests.PerformanceCounterTests failed in CI #60933

eerhardt opened this issue Oct 27, 2021 · 9 comments · Fixed by #73170
Labels
area-System.Diagnostics.PerformanceCounter disabled-test The test is disabled in source code against the issue good first issue Issue should be easy to implement, good for first-time contributors help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented Oct 27, 2021

Frequency:

Day Run Failures Notes
4/1-7/22
6/30 PR #68648 10 failures Win11 - Mono
6/28 PR #71397 10 failures Win10 - x86
6/15 Official run 10 failures Win11
6/13 PR #70403 10 failures Win10 - x86
5/7 PR #68993 10 failures Win11
4/6 PR #67557 10 failures Win11
4/2 Official run 10 failures Win10
let failedTests = (methodName : string, includePR : bool, messageSubstr: string, includePassedOnRerun : bool) {
cluster('engsrvprod.kusto.windows.net').database('engineeringdata').AzureDevOpsTests
    | where TestName contains methodName
    | where includePassedOnRerun or (Outcome == 'Failed')
    | extend startOfTestName = indexof_regex(TestName, @"[^.]+$")
    | extend Method = substring(TestName, startOfTestName)
    | extend Type = substring(TestName, 0, startOfTestName - 1)
    | project-away startOfTestName
    | where Message contains messageSubstr
    | distinct JobId, WorkItemId, Message, StackTrace, Method, Type, Arguments, Outcome
    | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').Jobs
        | where ((Branch == 'refs/heads/main') or (Branch == 'refs/heads/master') or (includePR and (Source startswith "pr/")))
        | where Type startswith "test/functional/cli/"
            and not(Properties contains "runtime-staging")
        | summarize arg_max(Finished, Properties, Type, Branch, Source, Started, QueueName) by JobId
        | project-rename JobType = Type) on JobId
    | extend PropertiesJson = parse_json(Properties)
    | extend OS = replace_regex(tostring(PropertiesJson.operatingSystem), @'\((.*)\).*|([^\(].*)', @'\1\2')
    | extend Runtime = iif(PropertiesJson.runtimeFlavor == "mono", "Mono", iif(PropertiesJson.DefinitionName contains "coreclr", "CoreCLR", ""))
    | extend TargetBranch = extractjson("$.['System.PullRequest.TargetBranch']", Properties)
    | extend Architecture = PropertiesJson.architecture
    | extend Scenario = iif(isempty(PropertiesJson.scenario), "--", PropertiesJson.scenario)
    | project-away PropertiesJson
};
failedTests('System.Diagnostics.Tests.InstanceDataTests', true, 'Category', true);

Test System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter has failed. Check the Test tab or this console log: https://helix.dot.net/api/2019-06-17/jobs/7fb481c8-b204-4809-9ac6-1f7db90f5e5d/workitems/System.Diagnostics.PerformanceCounter.Tests/console

Console log: 'System.Diagnostics.PerformanceCounter.Tests' from job 7fb481c8-b204-4809-9ac6-1f7db90f5e5d workitem a0e2d365-2975-4dd7-b36e-cc56d3df3997 (windows.7.amd64.open.rt) executed on machine a002OCP

C:\h\w\AA5A0982\w\ADD20987\e>taskkill.exe /f /im corerun.exe 
ERROR: The process "corerun.exe" not found.

C:\h\w\AA5A0982\w\ADD20987\e>call RunTests.cmd --runtime-path C:\h\w\AA5A0982\p 
----- start Wed 10/27/2021  3:46:34.80 ===============  To repro directly: ===================================================== 
pushd C:\h\w\AA5A0982\w\ADD20987\e\
"C:\h\w\AA5A0982\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.PerformanceCounter.Tests.runtimeconfig.json --depsfile System.Diagnostics.PerformanceCounter.Tests.deps.json xunit.console.dll System.Diagnostics.PerformanceCounter.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================

C:\h\w\AA5A0982\w\ADD20987\e>"C:\h\w\AA5A0982\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.PerformanceCounter.Tests.runtimeconfig.json --depsfile System.Diagnostics.PerformanceCounter.Tests.deps.json xunit.console.dll System.Diagnostics.PerformanceCounter.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Diagnostics.PerformanceCounter.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Diagnostics.PerformanceCounter.Tests (found 91 test cases)
  Starting:    System.Diagnostics.PerformanceCounter.Tests (parallel test collections = on, max threads = 2)
    System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter [FAIL]
      System.InvalidOperationException : Category does not exist.
      Stack Trace:
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(373,0): at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(479,0): at System.Diagnostics.PerformanceCounter.InitializeImpl()
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(453,0): at System.Diagnostics.PerformanceCounter.Initialize()
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(78,0): at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, String machineName)
        /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs(192,0): at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter()

Info: Successfully installed performance counters in C:\h\w\AA5A0982\t\dxbpy5oa.jfn\provider.man    System.Diagnostics.Tests.PerformanceDataTests.PerformanceCounter_PerformanceData [SKIP]
      Condition(s) not met: "IsRunnableEnvironment"

Info: Successfully uninstalled the performance counters from the counter definition XML file C:\h\w\AA5A0982\t\dxbpy5oa.jfn\provider.man.  Finished:    System.Diagnostics.PerformanceCounter.Tests
=== TEST EXECUTION SUMMARY ===
   System.Diagnostics.PerformanceCounter.Tests  Total: 94, Errors: 0, Failed: 1, Skipped: 1, Time: 66.084s
----- end Wed 10/27/2021  3:47:42.10 ----- exit code 1 ----------------------------------------------------------
2021-10-27 03:47:42,569: INFO: 2516: run(48): main: Beginning reading of test results.
2021-10-27 03:47:42,569: INFO: 2516: __init__(48): get_log_files: Searching 'C:\h\w\AA5A0982\w\ADD20987\e\..' for log files
2021-10-27 03:47:42,569: INFO: 2516: __init__(66): construct_log_list: Generated log list: console.0927879d.log:
  https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-60900-merge-7fb481c8b20448099a/System.Diagnostics.PerformanceCounter.Tests/console.0927879d.log?sv=2019-07-07&se=2021-11-16T03%3A32%3A07Z&sr=c&sp=rl&sig=w7TmCMmLjLzI7c%2Bfh8x2jkOV9DWDX64m%2BgXE4z5eMCg%3D

2021-10-27 03:47:42,569: INFO: 2516: __init__(90): read_results: Searching 'C:\h\w\AA5A0982\w\ADD20987\e' for test results files
2021-10-27 03:47:42,569: INFO: 2516: __init__(96): read_results: Found results file C:\h\w\AA5A0982\w\ADD20987\e\testResults.xml with format xunit
2021-10-27 03:47:42,569: INFO: 2516: __init__(90): read_results: Searching 'C:\h\w\AA5A0982\w\ADD20987\uploads' for test results files
2021-10-27 03:47:42,569: INFO: 2516: packing_test_reporter(30): report_results: Packing 94 test reports to 'C:\h\w\AA5A0982\w\ADD20987\e\__test_report.json'
2021-10-27 03:47:42,569: INFO: 2516: packing_test_reporter(33): report_results: Packed 31823 bytes
Found log 'C:\h\w\AA5A0982\w\ADD20987\e\..\console.0927879d.log'
Uri 'https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-60900-merge-7fb481c8b20448099a/System.Diagnostics.PerformanceCounter.Tests/console.0927879d.log?sv=2019-07-07&se=2021-11-16T03%3A32%3A07Z&sr=c&sp=rl&sig=w7TmCMmLjLzI7c%2Bfh8x2jkOV9DWDX64m%2BgXE4z5eMCg%3D'
Did not find dumps, skipping dump docs generation.
Build Kind Start Time
1583845 Rolling 2022-01-02
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Diagnostics.PerformanceCounter untriaged New issue has not been triaged by the area owner labels Oct 27, 2021
@krwq krwq changed the title PerformanceCounter_BeginInitEndInit_ProcessorCounter failed in CI System.Diagnostics.Tests.PerformanceCounterTests failed in CI Nov 2, 2021
@krwq
Copy link
Member

krwq commented Nov 2, 2021

I'm reusing this issue since I've seen similar issue in different random tests across PerformanceCounters.
List of tests I've seen failing similarly in the past 14 days:

  • System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_CategoryType_MultiInstance
  • System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_InstanceExists_Static
  • System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_ReadCategory
  • System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter
  • System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_CreateCounter_ProcessorCounter
  • System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Decrement_DecrementReadOnly
  • System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_NextValue_ProcessorCounter

@krwq
Copy link
Member

krwq commented Nov 2, 2021

I'm unclear if Mono issue: #53261 is the same or not so leaving that one for now. The above are Windows only (happened on Win 10, Win 11, Win 7) all on amd64 (although unclear if it's specific to this arch)

@krwq
Copy link
Member

krwq commented Nov 2, 2021

Also related: #60403

@krwq krwq added the disabled-test The test is disabled in source code against the issue label Nov 2, 2021
@danmoseley
Copy link
Member

Noting from offline discussion -- for some reason, we are getting an incomplete read from the registry key (which I think is dynamically populated?). Recommendation is that if a category isn’t present, we should sleep for a little while, call CloseSharedResources(), and try again. We would do this in tests only -- unless something has changed in Windows, it doesn't seem to be affecting real-world use unless we hear otherwise. If it does affect customers, we could potentially do it inside CounterExists(..) but could not "fix" GetCategories() since we have no way to tell whether it's returning everything.

@danmoseley danmoseley added help wanted [up-for-grabs] Good issue for external contributors good first issue Issue should be easy to implement, good for first-time contributors labels Nov 2, 2021
@sbomer
Copy link
Member

sbomer commented Feb 1, 2022

Hit again in ci for net7.0-windows-Release-x86-CoreCLR_release-Windows.7.Amd64.Open: build, log.

C:\h\w\C7BE09D6\w\A195091E\e>"C:\h\w\C7BE09D6\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.PerformanceCounter.Tests.runtimeconfig.json --depsfile System.Diagnostics.PerformanceCounter.Tests.deps.json xunit.console.dll System.Diagnostics.PerformanceCounter.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Diagnostics.PerformanceCounter.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Diagnostics.PerformanceCounter.Tests (found 91 test cases)
  Starting:    System.Diagnostics.PerformanceCounter.Tests (parallel test collections = on, max threads = 2)
    System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter [FAIL]
      System.InvalidOperationException : Category 'Processor' does not exist.
      Stack Trace:
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(374,0): at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(479,0): at System.Diagnostics.PerformanceCounter.InitializeImpl()
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(453,0): at System.Diagnostics.PerformanceCounter.Initialize()
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(78,0): at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, String machineName)
        /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs(194,0): at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter()

sbomer added a commit to sbomer/runtime that referenced this issue Feb 1, 2022
These tests were disabled in dotnet#61101
due to random failures like dotnet#60933.

We are continuing to see these failures on x86 as well.
jkotas pushed a commit that referenced this issue Feb 1, 2022
These tests were disabled in #61101
due to random failures like #60933.

We are continuing to see these failures on x86 as well.
@carlossanlop carlossanlop removed the untriaged New issue has not been triaged by the area owner label Feb 3, 2022
@carlossanlop carlossanlop added this to the 7.0.0 milestone Feb 3, 2022
@danmoseley
Copy link
Member

More, where retries aren't enough and we should try this "CloseSharedResources()" ...

❌ System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetItem_ExistingCounter [[Details]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140292&paneView=debug) [[History]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140292&paneView=history) [[Artifacts]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140292&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab)
Exception Message
System.AggregateException : One or more errors occurred. (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.)
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
CallStack
   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.Diagnostics.Tests.Helpers.RetryOnAllPlatforms[T](Func`1 func) in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 73
   at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollectionCollection() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollection() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 133
   at System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetItem_ExistingCounter() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 28
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* arguments, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs:line 383
----- Inner Stack Trace #1 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.Helpers.<>c__DisplayClass12_0`1.<RetryOnAllPlatforms>b__0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 75
   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 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.Helpers.<>c__DisplayClass12_0`1.<RetryOnAllPlatforms>b__0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 75
   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 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnosti
Pass Rate
Test has failed 3 out of 12135 runs (0.02%)
Failing Configuration
net7.0-windows-Debug-x64-CoreCLR_release-Windows.11.Amd64.ClientPre.Open
🔹 Test is not failing in target branch
❌ System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetKeys [[Details]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140291&paneView=debug) [[History]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140291&paneView=history) [[Artifacts]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140291&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab)
Exception Message
System.AggregateException : One or more errors occurred. (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.)
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
CallStack
   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.Diagnostics.Tests.Helpers.RetryOnAllPlatforms[T](Func`1 func) in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 73
   at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollectionCollection() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollection() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 133
   at System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetKeys() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 56
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* arguments, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs:line 383
----- Inner Stack Trace #1 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.Helpers.<>c__DisplayClass12_0`1.<RetryOnAllPlatforms>b__0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 75
   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 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.Helpers.<>c__DisplayClass12_0`1.<RetryOnAllPlatforms>b__0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 75
   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 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCo
Pass Rate
Test has failed 3 out of 12135 runs (0.02%)
Failing Configuration
net7.0-windows-Debug-x64-CoreCLR_release-Windows.11.Amd64.ClientPre.Open
🔹 Test is not failing in target branch
❌ System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetValues [[Details]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140285&paneView=debug) [[History]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140285&paneView=history) [[Artifacts]](https://dev.azure.com/dnceng//public/_build/results?buildId=1757267&view=ms.vss-test-web.build-test-results-tab&runId=47352292&resultId=140285&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab)
Exception Message
System.AggregateException : One or more errors occurred. (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.) (Category 'Processor' does not exist.)
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
---- System.InvalidOperationException : Category 'Processor' does not exist.
CallStack
   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.Diagnostics.Tests.Helpers.RetryOnAllPlatforms[T](Func`1 func) in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 73
   at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollectionCollection() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollection() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 133
   at System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetValues() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 67
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* arguments, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs:line 383
----- Inner Stack Trace #1 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.Helpers.<>c__DisplayClass12_0`1.<RetryOnAllPlatforms>b__0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 75
   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 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/InstanceDataTests.cs:line 128
   at System.Diagnostics.Tests.Helpers.<>c__DisplayClass12_0`1.<RetryOnAllPlatforms>b__0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 75
   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 (System.InvalidOperationException) -----
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 847
   at System.Diagnostics.PerformanceCounterCategory.ReadCategory() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 571
   at System.Diagnostics.Tests.InstanceDataTests.<>c__DisplayClass11_0.<GetInstanceDataCollectionCollection>b__1() in /_/src/libraries/System.Diagnostics.Performance

@danmoseley danmoseley added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label May 7, 2022
@radical
Copy link
Member

radical commented May 10, 2022

Hit again on #68921 . Build, and log:

Unhandled exception. System.InvalidOperationException: Category 'Processor' does not exist.
   at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs:line 393
   at System.Diagnostics.PerformanceCounter.InitializeImpl() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs:line 479
   at System.Diagnostics.PerformanceCounter.Initialize() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs:line 453
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, String machineName) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs:line 78
   at System.Diagnostics.Tests.PerformanceCounterTests.<>c.<RunWithGlobalizationInvariantModeTest>b__23_0() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs:line 342
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs:line 64
--- End of stack trace from previous location ---
   at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 94
    System.Diagnostics.Tests.PerformanceCounterTests.RunWithGlobalizationInvariantModeTest(predefinedCultures: False) [FAIL]
      Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception.
      Stack Trace:
        
        Child exception:
          System.InvalidOperationException: Category 'Processor' does not exist.
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs(393,0): at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(479,0): at System.Diagnostics.PerformanceCounter.InitializeImpl()
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(453,0): at System.Diagnostics.PerformanceCounter.Initialize()
        /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounter.cs(78,0): at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, String machineName)
        /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs(342,0): at System.Diagnostics.Tests.PerformanceCounterTests.<>c.<RunWithGlobalizationInvariantModeTest>b__23_0()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(64,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
        
        Child process:
          System.Diagnostics.PerformanceCounter.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 System.Diagnostics.Tests.PerformanceCounterTests+<>c Void <RunWithGlobalizationInvariantModeTest>b__23_0()

@karelz
Copy link
Member

karelz commented Jun 20, 2022

Happened again in 1825417 (6/14 PM) - 10 test failures:

  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_CopyTo
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_Contains_Valid
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetValues
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_GetItem_Invalid
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_GetKeys
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_Contains_inValid
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_NullTest
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_GetValues
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetKeys
  • System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollection_GetItem_ExistingCounter

@karelz
Copy link
Member

karelz commented Jul 22, 2022

Frequency updated in previous post. Given it is not super-common lately, removing blocking-clean-ci label.

@karelz karelz removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jul 22, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 1, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 17, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Diagnostics.PerformanceCounter disabled-test The test is disabled in source code against the issue good first issue Issue should be easy to implement, good for first-time contributors help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants