diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/classgc/ClassGCTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/classgc/ClassGCTest.java index e446d3db6..7f73cbe72 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/classgc/ClassGCTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/classgc/ClassGCTest.java @@ -24,7 +24,7 @@ public class ClassGCTest extends AbstractProfilerTest { @Override protected String getProfilerCommand() { - return "cpu=1ms,wall=1ms,filter=0,memory=524288:L,cstack=fp"; + return "cpu=1ms,wall=1ms,filter=0,memory=524288:L"; } private static final String CLASS_NAME = "code.Worker"; diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/CpuDumpSmokeTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/CpuDumpSmokeTest.java index 13a711062..9a7c6d1fe 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/CpuDumpSmokeTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/CpuDumpSmokeTest.java @@ -2,18 +2,26 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import org.junitpioneer.jupiter.RetryingTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.api.TestTemplate; -public class CpuDumpSmokeTest extends JfrDumpTest { +import com.datadoghq.profiler.junit.CStack; +import com.datadoghq.profiler.junit.RetryTest; +public class CpuDumpSmokeTest extends JfrDumpTest { + public CpuDumpSmokeTest(@CStack String cstack) { + super(cstack); + } @Override protected String getProfilerCommand() { - return "cpu=1ms,cstack=fp"; + return "cpu=1ms"; } - @RetryingTest(3) + @RetryTest(3) @Timeout(value = 60) - public void test() throws Exception { + @TestTemplate + @ValueSource(strings = {"vm", "vmx", "fp", "dwarf"}) + public void test(@CStack String cstack) throws Exception { runTest("datadog.ExecutionSample"); } } diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java index 210842afe..8d3fe4f89 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/JfrDumpTest.java @@ -1,6 +1,8 @@ package com.datadoghq.profiler.jfr; -import com.datadoghq.profiler.AbstractProfilerTest; +import com.datadoghq.profiler.CStackAwareAbstractProfilerTest; +import com.datadoghq.profiler.junit.RetryTest; +import com.datadoghq.profiler.junit.CStack; import com.datadoghq.profiler.Platform; import java.io.File; @@ -9,7 +11,10 @@ import org.junit.jupiter.api.Assumptions; -public abstract class JfrDumpTest extends AbstractProfilerTest { +public abstract class JfrDumpTest extends CStackAwareAbstractProfilerTest { + public JfrDumpTest(@CStack String cstack) { + super(cstack); + } public void runTest(String eventName) throws Exception { runTest(eventName, "method1", "method2", "method3"); diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java index c7196e4a7..41aab6641 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/ObjectSampleDumpSmokeTest.java @@ -4,10 +4,17 @@ import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.api.TestTemplate; -import org.junitpioneer.jupiter.RetryingTest; +import com.datadoghq.profiler.junit.CStack; +import com.datadoghq.profiler.junit.RetryTest; public class ObjectSampleDumpSmokeTest extends JfrDumpTest { + public ObjectSampleDumpSmokeTest(@CStack String cstack) { + super(cstack); + } + @Override protected boolean isPlatformSupported() { return !Platform.isJavaVersion(8) && !Platform.isJ9(); @@ -18,9 +25,11 @@ protected String getProfilerCommand() { return "memory=32:a"; } - @RetryingTest(5) + @RetryTest(5) @Timeout(value = 300) - public void test() throws Exception { + @TestTemplate + @ValueSource(strings = {"vm", "vmx", "fp", "dwarf"}) + public void test(@CStack String cstack) throws Exception { runTest("datadog.ObjectSample", 3, "method3"); } } diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/WallclockDumpSmokeTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/WallclockDumpSmokeTest.java index 8b20d92ca..b2cb43140 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/WallclockDumpSmokeTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/jfr/WallclockDumpSmokeTest.java @@ -1,19 +1,27 @@ package com.datadoghq.profiler.jfr; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.api.TestTemplate; -import org.junitpioneer.jupiter.RetryingTest; +import com.datadoghq.profiler.junit.CStack; +import com.datadoghq.profiler.junit.RetryTest; public class WallclockDumpSmokeTest extends JfrDumpTest { + public WallclockDumpSmokeTest(@CStack String cstack) { + super(cstack); + } @Override protected String getProfilerCommand() { return "wall=5ms"; } - @RetryingTest(3) + @RetryTest(3) @Timeout(value = 60) - public void test() throws Exception { + @TestTemplate + @ValueSource(strings = {"vm", "vmx", "fp", "dwarf"}) + public void test(@CStack String cstack) throws Exception { registerCurrentThreadForWallClockProfiling(); runTest("datadog.MethodSample"); } diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/GCGenerationsTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/GCGenerationsTest.java index 092a5ad45..a7bcb5cf6 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/GCGenerationsTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/GCGenerationsTest.java @@ -20,7 +20,7 @@ public class GCGenerationsTest extends AbstractProfilerTest { @Override protected String getProfilerCommand() { - return "memory=128,generations=true,cstack=fp"; + return "memory=128,generations=true"; } @Override diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/MemleakProfilerTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/MemleakProfilerTest.java index e1adb654d..adbca5ab6 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/MemleakProfilerTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/memleak/MemleakProfilerTest.java @@ -20,7 +20,7 @@ public class MemleakProfilerTest extends AbstractProfilerTest { @Override protected String getProfilerCommand() { - return "memory=524288:L:0.5,cstack=fp"; + return "memory=524288:L:0.5"; } @Override