From d54a59033b622728968a0593deb70c69a23eacf9 Mon Sep 17 00:00:00 2001 From: Krzysztof Wicher Date: Tue, 2 Nov 2021 16:35:58 +0100 Subject: [PATCH 1/2] Disable couple of randomly failing PerformanceCounter tests --- .../tests/PerformanceCounterCategoryTests.cs | 3 +++ .../tests/PerformanceCounterTests.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs index 77b13ae280d75..a7529e41551b6 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs @@ -78,6 +78,7 @@ public static void PerformanceCounterCategory_GetCounterHelp_Invalid() } [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndCanWriteAndReadNetPerfCounters))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounterCategory_CategoryType_MultiInstance() { string categoryName = nameof(PerformanceCounterCategory_CategoryType_MultiInstance) + "_Category"; @@ -280,6 +281,7 @@ public static void PerformanceCounterCategory_InstanceExists_Static() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounterCategory_InstanceExists_StaticInvalid() { Assert.Throws(() => PerformanceCounterCategory.InstanceExists(null, "Processor", ".")); @@ -289,6 +291,7 @@ public static void PerformanceCounterCategory_InstanceExists_StaticInvalid() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounterCategory_ReadCategory() { PerformanceCounterCategory pcc = Helpers.RetryOnAllPlatforms(() => new PerformanceCounterCategory("Processor")); diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs index 1c90fa6d36bbb..89770aa2321fd 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterTests.cs @@ -39,6 +39,7 @@ public static void PerformanceCounter_CreateCounter_Count0() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounter_CreateCounter_ProcessorCounter() { using (PerformanceCounter counterSample = new PerformanceCounter("Processor", "Interrupts/sec", "0", ".")) @@ -187,6 +188,7 @@ public static void PerformanceCounter_BeginInit_ProcessorCounter() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounter_BeginInitEndInit_ProcessorCounter() { using (PerformanceCounter counterSample = new PerformanceCounter("Processor", "Interrupts/sec", "0", ".")) @@ -268,6 +270,7 @@ public static void PerformanceCounter_Increment_IncrementReadOnly() } [ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndCanWriteAndReadNetPerfCounters))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounter_Decrement_DecrementReadOnly() { string categoryName = nameof(PerformanceCounter_Decrement_DecrementReadOnly) + "_Category"; From bf4654f98deff3ac44101365b212dfd7e0c53843 Mon Sep 17 00:00:00 2001 From: Krzysztof Wicher Date: Tue, 2 Nov 2021 16:58:00 +0100 Subject: [PATCH 2/2] fix: disabled the wrong test --- .../tests/PerformanceCounterCategoryTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs index a7529e41551b6..b7da86114a334 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/tests/PerformanceCounterCategoryTests.cs @@ -267,6 +267,7 @@ public static void PerformanceCounterCategory_InstanceExists_Invalid() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounterCategory_InstanceExists_Static() { PerformanceCounterCategory pcc = Helpers.RetryOnAllPlatforms(() => new PerformanceCounterCategory("Processor")); @@ -281,7 +282,6 @@ public static void PerformanceCounterCategory_InstanceExists_Static() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60933", typeof(PlatformDetection), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.Is64BitProcess))] public static void PerformanceCounterCategory_InstanceExists_StaticInvalid() { Assert.Throws(() => PerformanceCounterCategory.InstanceExists(null, "Processor", "."));