Remove unstable ThreadPool events test (#56680)
authorNoah Falk <noahfalk@users.noreply.github.com>
Fri, 6 Aug 2021 07:18:26 +0000 (00:18 -0700)
committerGitHub <noreply@github.com>
Fri, 6 Aug 2021 07:18:26 +0000 (00:18 -0700)
The threadpool events being verified by this test aren't
guaranteed to occur given the test code. All of them are
the results of background timers and relative execution
speed of work items. Given the relatively low event coverage
of the existing test and my historical understanding that
specific events don't often regress, trying to stabilize this test
is probably more hassle than it is worth.

src/tests/issues.targets
src/tests/tracing/eventpipe/eventsvalidation/ThreadPool.cs [deleted file]
src/tests/tracing/eventpipe/eventsvalidation/ThreadPool.csproj [deleted file]

index 828fb48..4bd0de0 100644 (file)
         <ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294/*">
             <Issue>https://github.com/dotnet/runtime/issues/44341</Issue>
         </ExcludeList>
-        <ExcludeList Include="$(XunitTestBinBase)/tracing/eventpipe/eventsvalidation/ThreadPool/*">
-            <Issue>https://github.com/dotnet/runtime/issues/48727</Issue>
-        </ExcludeList>
     </ItemGroup>
 
     <!-- All Unix targets on all runtimes -->
diff --git a/src/tests/tracing/eventpipe/eventsvalidation/ThreadPool.cs b/src/tests/tracing/eventpipe/eventsvalidation/ThreadPool.cs
deleted file mode 100644 (file)
index 37a58ed..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.Diagnostics.Tracing;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Diagnostics.Tools.RuntimeClient;
-using Microsoft.Diagnostics.Tracing;
-using Tracing.Tests.Common;
-
-namespace Tracing.Tests.GCFinalizers
-{
-    public class ProviderValidation
-    {
-        public static int Main(string[] args)
-        {
-            var providers = new List<Provider>()
-            {
-                new Provider("Microsoft-DotNETCore-SampleProfiler"),
-                //ThreadingKeyword (0x10000)
-                new Provider("Microsoft-Windows-DotNETRuntime", 0x10000, EventLevel.Verbose)
-            };
-            
-            var configuration = new SessionConfiguration(circularBufferSizeMB: 1024, format: EventPipeSerializationFormat.NetTrace,  providers: providers);
-            return IpcTraceTest.RunAndValidateEventCounts(_expectedEventCounts, _eventGeneratingAction, configuration, _DoesTraceContainEvents);
-        }
-
-        private static Dictionary<string, ExpectedEventCount> _expectedEventCounts = new Dictionary<string, ExpectedEventCount>()
-        {
-            { "Microsoft-Windows-DotNETRuntime", -1 },
-            { "Microsoft-Windows-DotNETRuntimeRundown", -1 },
-            { "Microsoft-DotNETCore-SampleProfiler", -1 }
-        };
-
-        private static Action _eventGeneratingAction = () => 
-        {
-            Task[] tasks = new Task[50];
-            for (int i = 0; i < 50; i++)
-            {
-                tasks[i] = Task.Run(async () => {
-                    long total = 0;
-                    await Task.Delay(10);
-                    var rnd = new Random();
-                    for (int n = 1; n <= 100; n++)
-                        total += rnd.Next(0, 100);
-                    return total;
-                });
-            }
-            Task.WaitAll(tasks);
-        };
-
-        private static Func<EventPipeEventSource, Func<int>> _DoesTraceContainEvents = (source) => 
-        {
-            int threadPoolEventsCount = 0;
-            source.Clr.ThreadPoolWorkerThreadStart += (_) => threadPoolEventsCount += 1;
-            source.Clr.ThreadPoolWorkerThreadWait += (_) => threadPoolEventsCount += 1;
-            source.Clr.ThreadPoolWorkerThreadStop += (_) => threadPoolEventsCount += 1;
-            source.Clr.ThreadPoolWorkerThreadAdjustmentSample += (_) => threadPoolEventsCount += 1;
-            source.Clr.ThreadPoolWorkerThreadAdjustmentAdjustment += (_) => threadPoolEventsCount += 1;
-            return () => {
-                Logger.logger.Log("Event counts validation");
-                return threadPoolEventsCount >= 50 ? 100 : -1;
-            };
-        };
-    }
-}
diff --git a/src/tests/tracing/eventpipe/eventsvalidation/ThreadPool.csproj b/src/tests/tracing/eventpipe/eventsvalidation/ThreadPool.csproj
deleted file mode 100644 (file)
index aec8e05..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
-    <OutputType>exe</OutputType>
-    <CLRTestKind>BuildAndRun</CLRTestKind>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <CLRTestPriority>1</CLRTestPriority>
-    <UnloadabilityIncompatible>true</UnloadabilityIncompatible>
-    <JitOptimizationSensitive>true</JitOptimizationSensitive>
-    <GCStressIncompatible>true</GCStressIncompatible>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="ThreadPool.cs" />
-    <ProjectReference Include="../common/common.csproj" />
-  </ItemGroup>
-</Project>