From 55f4cfdca930a52e48362af93a21825603cf1fae Mon Sep 17 00:00:00 2001 From: Christophe Nasarre Date: Thu, 28 Nov 2024 13:16:19 +0100 Subject: [PATCH] Pick a less CPU intensive scenario + increase tests timeout --- .../Allocations/AllocationsProfilerTest.cs | 4 +++- .../Contention/ContentionProfilerTest.cs | 4 +++- .../GarbageCollections/GarbageCollectionsProfilerTest.cs | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/profiler/test/Datadog.Profiler.IntegrationTests/Allocations/AllocationsProfilerTest.cs b/profiler/test/Datadog.Profiler.IntegrationTests/Allocations/AllocationsProfilerTest.cs index 48ded5046633..6f8bf0196298 100644 --- a/profiler/test/Datadog.Profiler.IntegrationTests/Allocations/AllocationsProfilerTest.cs +++ b/profiler/test/Datadog.Profiler.IntegrationTests/Allocations/AllocationsProfilerTest.cs @@ -18,7 +18,7 @@ public class AllocationsProfilerTest { private const string ScenarioGenerics = "--scenario 9"; private const string ScenarioMeasureAllocation = "--scenario 16"; - private const string ScenarioWithoutGC = "--scenario 25 --threads 2 --param 1000"; + private const string ScenarioWithoutGC = "--scenario 6 --threads 1"; private readonly ITestOutputHelper _output; @@ -130,6 +130,8 @@ public void MeasureAllocations(string appName, string framework, string appAssem public void ShouldGetAllocationSamplesViaEtw(string appName, string framework, string appAssembly) { var runner = new TestApplicationRunner(appName, framework, appAssembly, _output, commandLine: ScenarioWithoutGC); + // allow agent proxy to send the recorded events + runner.TestDurationInSeconds = 30; EnvironmentHelper.DisableDefaultProfilers(runner); runner.Environment.SetVariable(EnvironmentVariables.AllocationProfilerEnabled, "1"); diff --git a/profiler/test/Datadog.Profiler.IntegrationTests/Contention/ContentionProfilerTest.cs b/profiler/test/Datadog.Profiler.IntegrationTests/Contention/ContentionProfilerTest.cs index cb41283bd4fc..968d90841d54 100644 --- a/profiler/test/Datadog.Profiler.IntegrationTests/Contention/ContentionProfilerTest.cs +++ b/profiler/test/Datadog.Profiler.IntegrationTests/Contention/ContentionProfilerTest.cs @@ -15,7 +15,7 @@ namespace Datadog.Profiler.IntegrationTests.Contention public class ContentionProfilerTest { private const string ScenarioContention = "--scenario 10 --threads 20"; - private const string ScenarioWithoutContention = "--scenario 25 --threads 2 --param 1000"; + private const string ScenarioWithoutContention = "--scenario 6 --threads 1"; private readonly ITestOutputHelper _output; @@ -90,6 +90,8 @@ public void ExplicitlyDisableContentionProfiler(string appName, string framework public void ShouldGetLockContentionSamplesViaEtw(string appName, string framework, string appAssembly) { var runner = new TestApplicationRunner(appName, framework, appAssembly, _output, commandLine: ScenarioWithoutContention); + // allow agent proxy to send the recorded events + runner.TestDurationInSeconds = 30; EnvironmentHelper.DisableDefaultProfilers(runner); runner.Environment.SetVariable(EnvironmentVariables.ContentionProfilerEnabled, "1"); diff --git a/profiler/test/Datadog.Profiler.IntegrationTests/GarbageCollections/GarbageCollectionsProfilerTest.cs b/profiler/test/Datadog.Profiler.IntegrationTests/GarbageCollections/GarbageCollectionsProfilerTest.cs index 4e3cd453ece2..e86af0af7f50 100644 --- a/profiler/test/Datadog.Profiler.IntegrationTests/GarbageCollections/GarbageCollectionsProfilerTest.cs +++ b/profiler/test/Datadog.Profiler.IntegrationTests/GarbageCollections/GarbageCollectionsProfilerTest.cs @@ -14,7 +14,7 @@ namespace Datadog.Profiler.IntegrationTests.GarbageCollections public class GarbageCollectionsProfilerTest { private const string ScenarioGenerics = "--scenario 12"; - private const string ScenarioWithoutGC = "--scenario 25 --threads 2 --param 1000"; + private const string ScenarioWithoutGC = "--scenario 6 --threads 1"; private const string GcRootFrame = "|lm: |ns: |ct: |cg: |fn:Garbage Collector |fg: |sg:"; private readonly ITestOutputHelper _output; @@ -62,6 +62,8 @@ public void ShouldGetGarbageCollectionSamplesByDefault(string appName, string fr public void ShouldGetGarbageCollectionSamplesViaEtw(string appName, string framework, string appAssembly) { var runner = new TestApplicationRunner(appName, framework, appAssembly, _output, commandLine: ScenarioWithoutGC); + // allow agent proxy to send the recorded events + runner.TestDurationInSeconds = 30; // disable default profilers except GC runner.Environment.SetVariable(EnvironmentVariables.WallTimeProfilerEnabled, "0");