Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Retrys consistent #1442

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 10, delay = 5)
@Retry(count = 10, delay = 500)
@Unroll
class CouchbaseSpringTemplateTest extends AbstractCouchbaseTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.REDIRE
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS

// Work around for: address already in use
@Retry
@Retry(count = 5, delay = 100)
class DropwizardTest extends HttpServerTest<DropwizardTestSupport> {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -15,9 +14,10 @@ import org.elasticsearch.common.settings.Settings
import org.elasticsearch.node.InternalSettingsPreparer
import org.elasticsearch.node.Node
import org.elasticsearch.transport.Netty4Plugin
import spock.lang.Retry
import spock.lang.Shared

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch6RestClientTest extends AgentTestRunner {
@Shared
int httpPort
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -16,11 +15,12 @@ import org.elasticsearch.env.Environment
import org.elasticsearch.node.Node
import org.elasticsearch.node.internal.InternalSettingsPreparer
import org.elasticsearch.transport.Netty3Plugin
import spock.lang.Retry
import spock.lang.Shared

import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch5RestClientTest extends AgentTestRunner {
@Shared
int httpPort
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -18,9 +17,10 @@ import org.elasticsearch.node.InternalSettingsPreparer
import org.elasticsearch.node.Node
import org.elasticsearch.plugins.Plugin
import org.elasticsearch.transport.Netty4Plugin
import spock.lang.Retry
import spock.lang.Shared

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch6RestClientTest extends AgentTestRunner {
@Shared
int httpPort
Expand Down Expand Up @@ -125,6 +125,7 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
}

@Override
protected void registerDerivedNodeNameWithLogger(String nodeName) {}
protected void registerDerivedNodeNameWithLogger(String nodeName) {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -15,9 +14,10 @@ import org.elasticsearch.common.settings.Settings
import org.elasticsearch.node.InternalSettingsPreparer
import org.elasticsearch.node.Node
import org.elasticsearch.transport.Netty4Plugin
import spock.lang.Retry
import spock.lang.Shared

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch6RestClientTest extends AgentTestRunner {
@Shared
int httpPort
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -9,11 +8,12 @@ import org.elasticsearch.common.settings.Settings
import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.Node
import org.elasticsearch.node.NodeBuilder
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch2NodeClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -12,11 +11,12 @@ import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.Node
import org.elasticsearch.node.NodeBuilder
import org.elasticsearch.transport.RemoteTransportException
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch2TransportClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -9,11 +8,12 @@ import org.elasticsearch.common.settings.Settings
import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.Node
import org.elasticsearch.node.NodeBuilder
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch2NodeClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -13,11 +12,12 @@ import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.Node
import org.elasticsearch.node.NodeBuilder
import org.elasticsearch.transport.RemoteTransportException
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch2TransportClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -11,12 +10,13 @@ import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.InternalSettingsPreparer
import org.elasticsearch.node.Node
import org.elasticsearch.transport.Netty3Plugin
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch53NodeClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -15,12 +14,13 @@ import org.elasticsearch.node.Node
import org.elasticsearch.transport.Netty3Plugin
import org.elasticsearch.transport.RemoteTransportException
import org.elasticsearch.transport.client.PreBuiltTransportClient
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch53TransportClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -11,12 +10,13 @@ import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.Node
import org.elasticsearch.node.internal.InternalSettingsPreparer
import org.elasticsearch.transport.Netty3Plugin
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch5NodeClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -15,12 +14,13 @@ import org.elasticsearch.node.internal.InternalSettingsPreparer
import org.elasticsearch.transport.Netty3Plugin
import org.elasticsearch.transport.RemoteTransportException
import org.elasticsearch.transport.client.PreBuiltTransportClient
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch5TransportClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -10,12 +9,13 @@ import org.elasticsearch.index.IndexNotFoundException
import org.elasticsearch.node.InternalSettingsPreparer
import org.elasticsearch.node.Node
import org.elasticsearch.transport.Netty4Plugin
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch6NodeClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.anotherchrisberry.spock.extensions.retry.RetryOnFailure
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.utils.PortUtils
import datadog.trace.api.DDSpanTypes
Expand All @@ -14,12 +13,13 @@ import org.elasticsearch.node.Node
import org.elasticsearch.transport.Netty4Plugin
import org.elasticsearch.transport.RemoteTransportException
import org.elasticsearch.transport.client.PreBuiltTransportClient
import spock.lang.Retry
import spock.lang.Shared

import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING

@RetryOnFailure(times = 3, delaySeconds = 1)
@Retry(count = 3, delay = 1000)
class Elasticsearch6TransportClientTest extends AgentTestRunner {
public static final long TIMEOUT = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
* limitations under the License.
*/


import datadog.trace.agent.test.AgentTestRunner
import listener.Config
import org.apache.activemq.ActiveMQMessageConsumer
import org.apache.activemq.junit.EmbeddedActiveMQBroker
import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.jms.core.JmsTemplate
import org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter
import spock.lang.Retry

import javax.jms.ConnectionFactory

import static JMS1Test.consumerTrace
import static JMS1Test.producerTrace

@Retry
class SpringListenerJMS1Test extends AgentTestRunner {

def "receiving message in spring listener generates spans"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import okhttp3.Request
import spock.lang.Retry
import spock.lang.Shared

@Retry(delay = 20)
@Retry(delay = 1000)
class WildflySmokeTest extends AbstractServerSmokeTest {

@Shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import static datadog.trace.common.writer.DDAgentWriter.DISRUPTOR_BUFFER_SIZE
import static datadog.trace.core.SpanFactory.newSpanOf
import static datadog.trace.core.serialization.MsgpackFormatWriter.MSGPACK_WRITER

@Timeout(20)
@Retry
@Timeout(10)
class DDAgentWriterTest extends DDSpecification {

def phaser = new Phaser()
Expand Down Expand Up @@ -401,7 +402,7 @@ class DDAgentWriterTest extends DDSpecification {
1 * monitor.onShutdown(writer, true)
}

@Retry(delay = 10)
@Retry(delay = 500)
// if execution is too slow, the http client timeout may trigger.
def "slow response test"() {
def numWritten = 0
Expand All @@ -419,9 +420,6 @@ class DDAgentWriterTest extends DDSpecification {
def agent = httpServer {
handlers {
put("v0.4/traces") {
// DDApi sniffs for end point existence, so respond quickly the first time
// then slowly thereafter

responseSemaphore.acquire()
try {
response.status(200).send()
Expand Down