Skip to content

Commit 0069b78

Browse files
committed
Fix post-merge issue
1 parent f37c464 commit 0069b78

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

dd-java-agent/agent-profiling/profiling-controller-ddprof/src/test/java/com/datadog/profiling/controller/ddprof/DatadogProfilerOngoingRecordingTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import datadog.trace.api.profiling.RecordingData;
88
import java.time.Instant;
99
import org.junit.jupiter.api.AfterEach;
10-
import org.junit.jupiter.api.Assumptions;
1110
import org.junit.jupiter.api.BeforeAll;
1211
import org.junit.jupiter.api.BeforeEach;
1312
import org.junit.jupiter.api.Test;
@@ -34,8 +33,8 @@ public class DatadogProfilerOngoingRecordingTest {
3433
public static void setupAll() {
3534
// If the profiler couldn't be loaded, the reason why is saved.
3635
// This test assumes the profiler could be loaded.
37-
Assume.assumeNoException(
38-
"profiler not available", DdprofLibraryLoader.javaProfiler().getReasonNotLoaded());
36+
assertDoesNotThrow(
37+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
3938
}
4039

4140
@BeforeEach

dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerRecordingTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.datadog.profiling.ddprof;
22

3+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
34
import static org.junit.jupiter.api.Assertions.assertFalse;
45
import static org.junit.jupiter.api.Assertions.assertNotNull;
56
import static org.junit.jupiter.api.Assertions.assertTrue;
7+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
68

79
import datadog.environment.OperatingSystem;
810
import datadog.libs.ddprof.DdprofLibraryLoader;
@@ -23,13 +25,13 @@ class DatadogProfilerRecordingTest {
2325

2426
@BeforeEach
2527
void setup() throws Exception {
26-
Assume.assumeTrue(OperatingSystem.isLinux());
27-
Assume.assumeNoException(
28-
"Profiler not available", DdprofLibraryLoader.jvmAccess().getReasonNotLoaded());
28+
assumeTrue(OperatingSystem.isLinux());
29+
assertDoesNotThrow(
30+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
2931
profiler = DatadogProfiler.newInstance(ConfigProvider.getInstance());
3032
Assumptions.assumeFalse(profiler.isActive());
3133
recording = (DatadogProfilerRecording) profiler.start();
32-
Assumptions.assumeTrue(recording != null);
34+
assumeTrue(recording != null);
3335
}
3436

3537
@AfterEach
@@ -43,26 +45,26 @@ void shutdown() {
4345

4446
@Test
4547
void testClose() throws Exception {
46-
Assume.assumeNoException(
47-
"Profiler not available", DdprofLibraryLoader.javaProfiler().getReasonNotLoaded());
48+
assertDoesNotThrow(
49+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
4850
assertTrue(Files.exists(recording.getRecordingFile()));
4951
recording.close();
5052
assertFalse(Files.exists(recording.getRecordingFile()));
5153
}
5254

5355
@Test
5456
void testStop() throws Exception {
55-
Assume.assumeNoException(
56-
"Profiler not available", DdprofLibraryLoader.javaProfiler().getReasonNotLoaded());
57+
assertDoesNotThrow(
58+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
5759
RecordingData data = recording.stop();
5860
assertNotNull(data);
5961
assertTrue(Files.exists(recording.getRecordingFile()));
6062
}
6163

6264
@Test
6365
void testSnapshot() throws Exception {
64-
Assume.assumeNoException(
65-
"Profiler not available", DdprofLibraryLoader.javaProfiler().getReasonNotLoaded());
66+
assertDoesNotThrow(
67+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
6668
RecordingData data = recording.snapshot(Instant.now());
6769
assertNotNull(data);
6870
assertTrue(Files.exists(recording.getRecordingFile()));

dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.datadog.profiling.ddprof;
22

33
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
4+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
45
import static org.junit.jupiter.api.Assertions.assertFalse;
56
import static org.junit.jupiter.api.Assertions.assertNotNull;
67
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -42,8 +43,8 @@ public void setup() {
4243

4344
@Test
4445
void test() throws Exception {
45-
Assume.assumeNoException(
46-
"Profiler not available", DdprofLibraryLoader.javaProfiler().getReasonNotLoaded());
46+
assertDoesNotThrow(
47+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
4748
DatadogProfiler profiler = DatadogProfiler.newInstance(ConfigProvider.getInstance());
4849
assertFalse(profiler.enabledModes().isEmpty());
4950

@@ -76,8 +77,8 @@ void test() throws Exception {
7677
@ParameterizedTest
7778
@MethodSource("profilingModes")
7879
void testStartCmd(boolean cpu, boolean wall, boolean alloc, boolean memleak) throws Exception {
79-
Assume.assumeNoException(
80-
"Profiler not available", DdprofLibraryLoader.javaProfiler().getReasonNotLoaded());
80+
assertDoesNotThrow(
81+
() -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available");
8182
DatadogProfiler profiler =
8283
DatadogProfiler.newInstance(configProvider(cpu, wall, alloc, memleak));
8384

dd-smoke-tests/crashtracking/src/test/java/datadog/smoketest/CrashtrackingSmokeTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ void testCrashTracking() throws Exception {
180180
String onErrorArg =
181181
!Platform.isLinux()
182182
? "-XX:OnError=" + onErrorValue
183-
: ""; // on Linux we can automatically inject the arg
183+
: "-Ddd.crashtracking.debug.autoconfig.enable=true"; // on Linux we can automatically
184+
// inject the arg
184185
List<String> processArgs = new ArrayList<>();
185186
processArgs.add(javaPath());
186187
processArgs.add("-javaagent:" + agentShadowJar());
@@ -256,7 +257,8 @@ void testOomeTracking() throws Exception {
256257
String onOOMEArg =
257258
!Platform.isLinux()
258259
? "-XX:OnOutOfMemoryError=" + onErrorValue
259-
: ""; // on Linux we can automatically inject the arg
260+
: "-Ddd.crashtracking.debug.autoconfig.enable=true"; // on Linux we can automatically
261+
// inject the arg
260262

261263
List<String> processArgs = new ArrayList<>();
262264
processArgs.add(javaPath());

0 commit comments

Comments
 (0)