Set timeouts on individual tests and increase overall test timeout.
This commit is contained in:
parent
b7d599d82f
commit
f9e43516ad
|
@ -3,7 +3,9 @@ package datadog.trace.agent
|
||||||
import datadog.trace.agent.test.IntegrationTestUtils
|
import datadog.trace.agent.test.IntegrationTestUtils
|
||||||
import jvmbootstraptest.AgentLoadedChecker
|
import jvmbootstraptest.AgentLoadedChecker
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
|
import spock.lang.Timeout
|
||||||
|
|
||||||
|
@Timeout(30)
|
||||||
class AgentLoadedIntoBootstrapTest extends Specification {
|
class AgentLoadedIntoBootstrapTest extends Specification {
|
||||||
|
|
||||||
def "Agent loads in when separate jvm is launched"() {
|
def "Agent loads in when separate jvm is launched"() {
|
||||||
|
|
|
@ -4,7 +4,9 @@ import datadog.trace.agent.test.IntegrationTestUtils
|
||||||
import jvmbootstraptest.LogManagerSetter
|
import jvmbootstraptest.LogManagerSetter
|
||||||
import spock.lang.Requires
|
import spock.lang.Requires
|
||||||
import spock.lang.Specification
|
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
|
// 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") })
|
@Requires({ !System.getProperty("java.vm.name").contains("IBM J9 VM") })
|
||||||
class CustomLogManagerTest extends Specification {
|
class CustomLogManagerTest extends Specification {
|
||||||
|
|
|
@ -6,9 +6,11 @@ import jvmbootstraptest.AgentLoadedChecker
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.contrib.java.lang.system.RestoreSystemProperties
|
import org.junit.contrib.java.lang.system.RestoreSystemProperties
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
|
import spock.lang.Timeout
|
||||||
|
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
|
|
||||||
|
@Timeout(30)
|
||||||
class JMXFetchTest extends Specification {
|
class JMXFetchTest extends Specification {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package datadog.trace.agent
|
package datadog.trace.agent
|
||||||
|
|
||||||
import datadog.trace.agent.test.IntegrationTestUtils
|
import datadog.trace.agent.test.IntegrationTestUtils
|
||||||
|
|
||||||
import jvmbootstraptest.LogLevelChecker
|
import jvmbootstraptest.LogLevelChecker
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
|
import spock.lang.Timeout
|
||||||
|
|
||||||
|
@Timeout(30)
|
||||||
class LogLevelTest extends Specification {
|
class LogLevelTest extends Specification {
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,23 +17,25 @@ class LogLevelTest extends Specification {
|
||||||
def "dd.trace.debug false"() {
|
def "dd.trace.debug false"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddd.trace.debug=false","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddd.trace.debug=false", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, [:]
|
, [:]
|
||||||
, true) == 1
|
, true) == 1
|
||||||
}
|
}
|
||||||
|
|
||||||
def "SLF4J DEBUG && dd.trace.debug is false"() {
|
def "SLF4J DEBUG && dd.trace.debug is false"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddd.trace.debug=false","-Ddatadog.slf4j.simpleLogger.defaultLogLevel=debug","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddd.trace.debug=false", "-Ddatadog.slf4j.simpleLogger.defaultLogLevel=debug", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, [:]
|
, [:]
|
||||||
, true) == 0
|
, true) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
def "dd.trace.debug is false && DD_TRACE_DEBUG is true"() {
|
def "dd.trace.debug is false && DD_TRACE_DEBUG is true"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddd.trace.debug=false","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddd.trace.debug=false", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, ["DD_TRACE_DEBUG": "true"]
|
, ["DD_TRACE_DEBUG": "true"]
|
||||||
, true) == 1
|
, true) == 1
|
||||||
|
@ -42,7 +44,7 @@ class LogLevelTest extends Specification {
|
||||||
def "dd.trace.debug is true"() {
|
def "dd.trace.debug is true"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddd.trace.debug=true","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddd.trace.debug=true", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, [:]
|
, [:]
|
||||||
, true) == 0
|
, true) == 0
|
||||||
|
@ -52,7 +54,7 @@ class LogLevelTest extends Specification {
|
||||||
def "DD_TRACE_DEBUG is true"() {
|
def "DD_TRACE_DEBUG is true"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, ["DD_TRACE_DEBUG": "true"]
|
, ["DD_TRACE_DEBUG": "true"]
|
||||||
, true) == 0
|
, true) == 0
|
||||||
|
@ -61,18 +63,17 @@ class LogLevelTest extends Specification {
|
||||||
def "dd.trace.debug is true && DD_TRACE_DEBUG is false"() {
|
def "dd.trace.debug is true && DD_TRACE_DEBUG is false"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddd.trace.debug=true","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddd.trace.debug=true", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, ["DD_TRACE_DEBUG": "false"]
|
, ["DD_TRACE_DEBUG": "false"]
|
||||||
, true) == 0
|
, true) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def "SLF4J DEBUG && DD_TRACE_DEBUG is false"() {
|
def "SLF4J DEBUG && DD_TRACE_DEBUG is false"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddatadog.slf4j.simpleLogger.defaultLogLevel=debug","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddatadog.slf4j.simpleLogger.defaultLogLevel=debug", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, ["DD_TRACE_DEBUG": "false"]
|
, ["DD_TRACE_DEBUG": "false"]
|
||||||
, true) == 0
|
, true) == 0
|
||||||
|
@ -81,7 +82,7 @@ class LogLevelTest extends Specification {
|
||||||
def "SLF4J INFO && DD_TRACE_DEBUG is true"() {
|
def "SLF4J INFO && DD_TRACE_DEBUG is true"() {
|
||||||
expect:
|
expect:
|
||||||
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
IntegrationTestUtils.runOnSeparateJvm(LogLevelChecker.getName()
|
||||||
, ["-Ddatadog.slf4j.simpleLogger.defaultLogLevel=info","-Ddd.jmxfetch.enabled=false","-Ddd.trace.enabled=false"] as String[]
|
, ["-Ddatadog.slf4j.simpleLogger.defaultLogLevel=info", "-Ddd.jmxfetch.enabled=false", "-Ddd.trace.enabled=false"] as String[]
|
||||||
, "" as String[]
|
, "" as String[]
|
||||||
, ["DD_TRACE_DEBUG": "true"]
|
, ["DD_TRACE_DEBUG": "true"]
|
||||||
, true) == 1
|
, true) == 1
|
||||||
|
|
|
@ -332,8 +332,8 @@ for (def env : System.getenv().entrySet()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Test).configureEach {
|
tasks.withType(Test).configureEach {
|
||||||
// All tests must complete within 2 minutes.
|
// All tests must complete within 3 minutes.
|
||||||
timeout = Duration.ofMinutes(2)
|
timeout = Duration.ofMinutes(3)
|
||||||
|
|
||||||
// Disable all tests if skipTests property was specified
|
// Disable all tests if skipTests property was specified
|
||||||
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
onlyIf { !project.rootProject.hasProperty("skipTests") }
|
||||||
|
|
Loading…
Reference in New Issue