Skip to content

PerformanceCounter tests failing in CI #44208

Closed
@stephentoub

Description

@stephentoub

Inconsistently but frequently, PRs in CI have been failing tests from the System.Diagnostics.Tests.PerformanceCounterTests suite. When one test fails, a ton fail. They all look along the lines of this:

Error message
System.InvalidCastException : Unable to cast object of type 'System.String' to type 'System.String[]'.

Stack trace
   at System.Diagnostics.SharedPerformanceCounter.GetCategoryData() in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs:line 700
   at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName, PerformanceCounterInstanceLifetime lifetime) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs:line 96
   at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs:line 88
   at System.Diagnostics.SharedPerformanceCounter.RemoveAllInstances(String categoryName) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs:line 1389
   at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName) in /_/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterCategory.cs:line 395
   at System.Diagnostics.Tests.Helpers.DeleteCategory(String name) in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 46
   at System.Diagnostics.Tests.Helpers.CreateCategory(String name, PerformanceCounterCategoryType categoryType) in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/Helpers.cs:line 22
   at System.Diagnostics.Tests.PerformanceCounterTests.CreateCounterWithCategory(String name, Boolean readOnly, PerformanceCounterCategoryType categoryType) in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs:line 293
   at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_Decrement() in /_/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs:line 186

e.g. https://dev.azure.com/dnceng/public/_build/results?buildId=874236&view=ms.vss-test-web.build-test-results-tab&runId=27965576&resultId=121120&paneView=debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-VM-coreclrblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'bugtenet-reliabilityReliability/stability related issue (stress, load problems, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions