Attempt to improve test reliability
Add timeouts (to avoid a gradle level timeout) and retries (since we're doing it manually anyway).
I realize this is a band aid...
MODIFY
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/decorator/BaseDecoratorTest.groovy
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/decorator/BaseDecoratorTest.groovy
@@ -7,7 +7,10 @@ import datadog.trace.bootstrap.instrumentation.api.AgentSpan
import datadog.trace.util.test.DDSpecification
import io.opentracing.tag.Tags
import spock.lang.Shared
+import spock.lang.Timeout
+@Timeout(20)
+// onPeerConnection might be slow...
class BaseDecoratorTest extends DDSpecification {
@Shared

MODIFY
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/CleanerTest.groovy
dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/CleanerTest.groovy
@@ -3,6 +3,7 @@ package datadog.trace.agent.tooling
import datadog.common.exec.CommonTaskExecutor
import datadog.trace.util.gc.GCUtils
import datadog.trace.util.test.DDSpecification
+import spock.lang.Retry
import spock.lang.Subject
import java.lang.ref.WeakReference
@@ -11,6 +12,7 @@ import java.util.concurrent.atomic.AtomicInteger
import static java.util.concurrent.TimeUnit.MILLISECONDS
+@Retry
class CleanerTest extends DDSpecification {
@Subject

MODIFY
dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy
dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy
@@ -2,8 +2,9 @@ import datadog.trace.agent.test.asserts.TraceAssert
import datadog.trace.agent.test.base.HttpServerTest
import datadog.trace.api.DDSpanTypes
import datadog.trace.api.DDTags
-import datadog.trace.instrumentation.akkahttp.AkkaHttpServerDecorator
import datadog.trace.bootstrap.instrumentation.api.Tags
+import datadog.trace.instrumentation.akkahttp.AkkaHttpServerDecorator
+import spock.lang.Retry
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS
@@ -70,6 +71,7 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object,
}
}
+@Retry
class AkkaHttpServerInstrumentationTestSync extends AkkaHttpServerInstrumentationTest {
@Override
def startServer(int port) {
@@ -82,6 +84,7 @@ class AkkaHttpServerInstrumentationTestSync extends AkkaHttpServerInstrumentatio
}
}
+@Retry
class AkkaHttpServerInstrumentationTestAsync extends AkkaHttpServerInstrumentationTest {
@Override
def startServer(int port) {

MODIFY
dd-java-agent/instrumentation/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringTemplateTest.groovy
dd-java-agent/instrumentation/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringTemplateTest.groovy
@@ -14,7 +14,7 @@ import util.AbstractCouchbaseTest
import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
-@Retry(count = 5, delay = 1)
+@Retry(count = 10, delay = 5)
@Unroll
class CouchbaseSpringTemplateTest extends AbstractCouchbaseTest {

MODIFY
dd-java-agent/instrumentation/google-http-client/src/test/groovy/GoogleHttpClientTest.groovy
dd-java-agent/instrumentation/google-http-client/src/test/groovy/GoogleHttpClientTest.groovy
import com.google.api.client.http.HttpRequest
import com.google.api.client.http.HttpResponse
+import spock.lang.Retry
+@Retry
class GoogleHttpClientTest extends AbstractGoogleHttpClientTest {
@Override
HttpResponse executeRequest(HttpRequest request) {

MODIFY
dd-java-agent/instrumentation/jms/src/test/groovy/SpringTemplateJMS1Test.groovy
dd-java-agent/instrumentation/jms/src/test/groovy/SpringTemplateJMS1Test.groovy
@@ -3,6 +3,7 @@ import org.apache.activemq.ActiveMQConnectionFactory
import org.apache.activemq.ActiveMQMessageConsumer
import org.apache.activemq.junit.EmbeddedActiveMQBroker
import org.springframework.jms.core.JmsTemplate
+import spock.lang.Retry
import spock.lang.Shared
import javax.jms.Connection
@@ -13,6 +14,7 @@ import java.util.concurrent.TimeUnit
import static JMS1Test.consumerTrace
import static JMS1Test.producerTrace
+@Retry
class SpringTemplateJMS1Test extends AgentTestRunner {
@Shared
EmbeddedActiveMQBroker broker = new EmbeddedActiveMQBroker()

MODIFY
dd-java-agent/instrumentation/netty-4.1/src/test/groovy/Netty41ClientTest.groovy
dd-java-agent/instrumentation/netty-4.1/src/test/groovy/Netty41ClientTest.groovy
@@ -15,6 +15,7 @@ import org.asynchttpclient.AsyncCompletionHandler
import org.asynchttpclient.AsyncHttpClient
import org.asynchttpclient.DefaultAsyncHttpClientConfig
import org.asynchttpclient.Response
+import spock.lang.Retry
import spock.lang.Shared
import java.util.concurrent.ExecutionException
@@ -25,6 +26,7 @@ import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.asynchttpclient.Dsl.asyncHttpClient
+@Retry
class Netty41ClientTest extends HttpClientTest<NettyHttpClientDecorator> {
@Shared

MODIFY
dd-smoke-tests/wildfly/src/test/groovy/datadog/smoketest/WildflySmokeTest.groovy
dd-smoke-tests/wildfly/src/test/groovy/datadog/smoketest/WildflySmokeTest.groovy
@@ -2,8 +2,10 @@ package datadog.smoketest
import datadog.trace.agent.test.utils.PortUtils
import okhttp3.Request
+import spock.lang.Retry
import spock.lang.Shared
+@Retry(delay = 20)
class WildflySmokeTest extends AbstractServerSmokeTest {
@Shared

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/DDTracerTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/DDTracerTest.groovy
@@ -20,6 +20,7 @@ import io.opentracing.propagation.TextMapInject
import org.junit.Rule
import org.junit.contrib.java.lang.system.EnvironmentVariables
import org.junit.contrib.java.lang.system.RestoreSystemProperties
+import spock.lang.Timeout
import static datadog.trace.api.Config.DEFAULT_SERVICE_NAME
import static datadog.trace.api.Config.HEADER_TAGS
@@ -31,6 +32,7 @@ import static datadog.trace.api.Config.SPAN_TAGS
import static datadog.trace.api.Config.WRITER_TYPE
import static io.opentracing.propagation.Format.Builtin.TEXT_MAP_INJECT
+@Timeout(10)
class DDTracerTest extends DDSpecification {
@Rule

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/api/writer/DDAgentApiTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/api/writer/DDAgentApiTest.groovy
@@ -7,12 +7,14 @@ import datadog.trace.common.writer.ddagent.DDAgentApi
import datadog.trace.common.writer.ddagent.DDAgentResponseListener
import datadog.trace.util.test.DDSpecification
import org.msgpack.jackson.dataformat.MessagePackFactory
+import spock.lang.Timeout
import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.atomic.AtomicReference
import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer
+@Timeout(20)
class DDAgentApiTest extends DDSpecification {
static mapper = new ObjectMapper(new MessagePackFactory())

Attempt to improve test reliability

Add timeouts (to avoid a gradle level timeout) and retries (since we're doing it manually anyway).

I realize this is a band aid...