Skip to content

Commit 7c92a21

Browse files
authored
Add assert to SharedPerformanceCounter to debug test failures in CI (#44225)
1 parent ffe020f commit 7c92a21

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs

+1
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ private unsafe CategoryData GetCategoryData()
697697
}
698698
else
699699
{
700+
Debug.Assert(counterNamesObject is string[], $"Expected string[], got '{counterNamesObject}' with kind '{categoryKey.GetValueKind("Counter Names")}'for category '{_categoryName}'");
700701
string[] counterNames = (string[])counterNamesObject;
701702
for (int i = 0; i < counterNames.Length; i++)
702703
counterNames[i] = counterNames[i].ToLowerInvariant();

0 commit comments

Comments
 (0)