Increase ElasticSearch timeout in tests

Hopefully this would improve build stability
This commit is contained in:
Nikolay Martynov 2018-07-24 22:44:14 -04:00
parent f893948412
commit c98d5ef64b
7 changed files with 25 additions and 11 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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:

View File

@ -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:

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}