diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/alloc/AllocationProfilerTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/alloc/AllocationProfilerTest.java index 09d24e163..d995d065f 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/alloc/AllocationProfilerTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/alloc/AllocationProfilerTest.java @@ -22,6 +22,14 @@ protected boolean isPlatformSupported() { @RetryingTest(5) public void shouldGetObjectAllocationSamples() throws InterruptedException { + + // We seem to hit issues on j9: + // OSR (On stack replacement) creates crashes with the profiler. + // ----------- Stack Backtrace ----------- + // prepareForOSR+0xbf (0x00007F51062A4DDF [libj9jit29.so+0x4a4ddf]) + if (Platform.isJ9() && !Platform.isJavaVersionAtLeast(8)) { + return; + } Assumptions.assumeFalse(isAsan() || isTsan()); AllocatingTarget target1 = new AllocatingTarget(); diff --git a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java index e680633b7..0adbfd812 100644 --- a/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java +++ b/ddprof-test/src/test/java/com/datadoghq/profiler/wallclock/ContendedWallclockSamplesTest.java @@ -51,13 +51,18 @@ public void after() { @TestTemplate @ValueSource(strings = {"vm", "vmx", "fp", "dwarf"}) public void test(@CStack String cstack) { - String config = System.getProperty("ddprof_test.config"); - boolean isSanitizer = config.endsWith("san"); - boolean isJvmci = System.getProperty("java.vm.version", "").contains("jvmci"); - assumeFalse(Platform.isZing() || Platform.isJ9()); + // Skip test entirely on unsupported JVMs (don't use assumeFalse which gets retried) + if (Platform.isZing() || Platform.isJ9()) { + return; + } // Running vm stackwalker tests on JVMCI (Graal), JDK 24, aarch64 and with a sanitizer is crashing in a weird place // This looks like the sanitizer instrumentation is breaking the longjump based crash recovery :( - assumeFalse(Platform.isJavaVersionAtLeast(24) && isJvmci && Platform.isAarch64() && cstack.startsWith("vm") && isSanitizer); + String config = System.getProperty("ddprof_test.config"); + boolean isJvmci = System.getProperty("java.vm.version", "").contains("jvmci"); + boolean isSanitizer = config.endsWith("san"); + if (Platform.isJavaVersionAtLeast(24) && isJvmci && Platform.isAarch64() && cstack.startsWith("vm") && isSanitizer) { + return; + } long result = 0; for (int i = 0; i < 10; i++) {