Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Profiler] Avoid ETW tests flackiness #6368

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Loading