Increase ElasticSearch timeout in tests
Hopefully this would improve build stability
MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/Elasticsearch2NodeClientTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/Elasticsearch2NodeClientTest.groovy
@@ -16,6 +16,8 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -45,7 +47,7 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
testNode = NodeBuilder.newInstance().local(true).clusterName("test-cluster").settings(settings).build()
testNode.start()
TEST_WRITER.clear()
- testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
TEST_WRITER.waitForTraces(1)
}
@@ -132,7 +134,7 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
TEST_WRITER.size() == 1
when:
- client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
def emptyResult = client.prepareGet(indexName, indexType, id).get()
then:

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/Elasticsearch2SpringTemplateTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/Elasticsearch2SpringTemplateTest.groovy
@@ -26,6 +26,8 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -103,7 +105,7 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
def "test elasticsearch get"() {
expect:
template.createIndex(indexName)
- template.getClient().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ template.getClient().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
when:
NativeSearchQuery query = new NativeSearchQueryBuilder()
@@ -261,7 +263,7 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
def "test results extractor"() {
setup:
template.createIndex(indexName)
- testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
template.index(IndexQueryBuilder.newInstance()
.withObject(new Doc(id: 1, data: "doc a"))
.withIndexName(indexName)

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/Elasticsearch2TransportClientTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/Elasticsearch2TransportClientTest.groovy
@@ -19,6 +19,8 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -56,7 +58,7 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
).build()
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), tcpPort))
TEST_WRITER.clear()
- client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
TEST_WRITER.waitForTraces(1)
}
@@ -146,7 +148,7 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
TEST_WRITER.size() == 1
when:
- client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
def emptyResult = client.prepareGet(indexName, indexType, id).get()
then:

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-5/src/test/groovy/Elasticsearch5NodeClientTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-5/src/test/groovy/Elasticsearch5NodeClientTest.groovy
@@ -19,6 +19,8 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -51,7 +53,7 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner {
testNode = new Node(new Environment(InternalSettingsPreparer.prepareSettings(settings)), [Netty3Plugin])
testNode.start()
TEST_WRITER.clear()
- testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
TEST_WRITER.waitForTraces(1)
}
@@ -138,7 +140,7 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner {
TEST_WRITER.size() == 1
when:
- client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
def emptyResult = client.prepareGet(indexName, indexType, id).get()
then:

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-5/src/test/groovy/Elasticsearch5TransportClientTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-5/src/test/groovy/Elasticsearch5TransportClientTest.groovy
@@ -23,6 +23,8 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -63,7 +65,7 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
)
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), tcpPort))
TEST_WRITER.clear()
- client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
TEST_WRITER.waitForTraces(1)
}

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-6/src/test/groovy/Elasticsearch6NodeClientTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-6/src/test/groovy/Elasticsearch6NodeClientTest.groovy
@@ -18,6 +18,8 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -48,7 +50,7 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner {
testNode = new Node(InternalSettingsPreparer.prepareEnvironment(settings, null), [Netty4Plugin])
testNode.start()
TEST_WRITER.clear()
- testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
TEST_WRITER.waitForTraces(1)
}

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-6/src/test/groovy/Elasticsearch6TransportClientTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-6/src/test/groovy/Elasticsearch6TransportClientTest.groovy
@@ -22,6 +22,8 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
System.setProperty("dd.integration.elasticsearch.enabled", "true")
}
+ public static final long TIMEOUT = 10000; // 10 seconds
+
@Shared
int httpPort
@Shared
@@ -60,7 +62,7 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
)
client.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), tcpPort))
TEST_WRITER.clear()
- client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
+ client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
TEST_WRITER.waitForTraces(1)
}

Increase ElasticSearch timeout in tests

Hopefully this would improve build stability