Set timeouts on individual tests and increase overall test timeout.
MODIFY
dd-java-agent/src/test/groovy/datadog/trace/agent/AgentLoadedIntoBootstrapTest.groovy
dd-java-agent/src/test/groovy/datadog/trace/agent/AgentLoadedIntoBootstrapTest.groovy
@@ -3,7 +3,9 @@ package datadog.trace.agent
import datadog.trace.agent.test.IntegrationTestUtils
import jvmbootstraptest.AgentLoadedChecker
import spock.lang.Specification
+import spock.lang.Timeout
+@Timeout(30)
class AgentLoadedIntoBootstrapTest extends Specification {
def "Agent loads in when separate jvm is launched"() {

MODIFY
dd-java-agent/src/test/groovy/datadog/trace/agent/CustomLogManagerTest.groovy
dd-java-agent/src/test/groovy/datadog/trace/agent/CustomLogManagerTest.groovy
@@ -4,7 +4,9 @@ import datadog.trace.agent.test.IntegrationTestUtils
import jvmbootstraptest.LogManagerSetter
import spock.lang.Requires
import spock.lang.Specification
+import spock.lang.Timeout
+@Timeout(30)
// Note: this test is fails on IBM JVM, we would need to investigate this at some point
@Requires({ !System.getProperty("java.vm.name").contains("IBM J9 VM") })
class CustomLogManagerTest extends Specification {

MODIFY
dd-java-agent/src/test/groovy/datadog/trace/agent/JMXFetchTest.groovy
dd-java-agent/src/test/groovy/datadog/trace/agent/JMXFetchTest.groovy
@@ -6,9 +6,11 @@ import jvmbootstraptest.AgentLoadedChecker
import org.junit.Rule
import org.junit.contrib.java.lang.system.RestoreSystemProperties
import spock.lang.Specification
+import spock.lang.Timeout
import java.lang.reflect.Method
+@Timeout(30)
class JMXFetchTest extends Specification {
@Rule

MODIFY
dd-java-agent/src/test/groovy/datadog/trace/agent/LogLevelTest.groovy
dd-java-agent/src/test/groovy/datadog/trace/agent/LogLevelTest.groovy
package datadog.trace.agent
import datadog.trace.agent.test.IntegrationTestUtils
-
import jvmbootstraptest.LogLevelChecker
import spock.lang.Specification
+import spock.lang.Timeout
-
+@Timeout(30)
class LogLevelTest extends Specification {
@@ -22,6 +22,7 @@ class LogLevelTest extends Specification {
, [:]
, true) == 1
}
+
def "SLF4J DEBUG && dd.trace.debug is false"() {
expect:
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
@@ -30,6 +31,7 @@ class LogLevelTest extends Specification {
, [:]
, true) == 0
}
+
def "dd.trace.debug is false && DD_TRACE_DEBUG is true"() {
expect:
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
@@ -68,7 +70,6 @@ class LogLevelTest extends Specification {
}
-
def "SLF4J DEBUG && DD_TRACE_DEBUG is false"() {
expect:
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()

MODIFY
gradle/java.gradle
gradle/java.gradle
@@ -332,8 +332,8 @@ for (def env : System.getenv().entrySet()) {
}
tasks.withType(Test).configureEach {
- // All tests must complete within 2 minutes.
- timeout = Duration.ofMinutes(2)
+ // All tests must complete within 3 minutes.
+ timeout = Duration.ofMinutes(3)
// Disable all tests if skipTests property was specified
onlyIf { !project.rootProject.hasProperty("skipTests") }

Set timeouts on individual tests and increase overall test timeout.