Add some synchronization into ES tests to make them more stable
MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-2/src/latestDepTest/groovy/springdata/Elasticsearch2SpringTemplateTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-2/src/latestDepTest/groovy/springdata/Elasticsearch2SpringTemplateTest.groovy
@@ -105,7 +105,9 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
def "test elasticsearch get"() {
expect:
template.createIndex(indexName)
+ TEST_WRITER.waitForTraces(1)
template.getClient().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
+ TEST_WRITER.waitForTraces(2)
when:
NativeSearchQuery query = new NativeSearchQueryBuilder()
@@ -277,7 +279,10 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
def "test results extractor"() {
setup:
template.createIndex(indexName)
+ TEST_WRITER.waitForTraces(1)
testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
+ TEST_WRITER.waitForTraces(2)
+
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/springdata/Elasticsearch2SpringTemplateTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-2/src/test/groovy/springdata/Elasticsearch2SpringTemplateTest.groovy
@@ -105,7 +105,9 @@ class Elasticsearch2SpringTemplateTest extends AgentTestRunner {
def "test elasticsearch get"() {
expect:
template.createIndex(indexName)
+ TEST_WRITER.waitForTraces(1)
template.getClient().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
+ TEST_WRITER.waitForTraces(2)
when:
NativeSearchQuery query = new NativeSearchQueryBuilder()

MODIFY
dd-java-agent/instrumentation/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringTemplateTest.groovy
dd-java-agent/instrumentation/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringTemplateTest.groovy
@@ -125,7 +125,9 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner {
def "test elasticsearch get"() {
expect:
template.createIndex(indexName)
+ TEST_WRITER.waitForTraces(1)
template.getClient().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
+ TEST_WRITER.waitForTraces(2)
when:
NativeSearchQuery query = new NativeSearchQueryBuilder()
@@ -305,7 +307,10 @@ class Elasticsearch53SpringTemplateTest extends AgentTestRunner {
def "test results extractor"() {
setup:
template.createIndex(indexName)
+ TEST_WRITER.waitForTraces(1)
testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(TIMEOUT)
+ TEST_WRITER.waitForTraces(2)
+
template.index(IndexQueryBuilder.newInstance()
.withObject(new Doc(id: 1, data: "doc a"))
.withIndexName(indexName)

Add some synchronization into ES tests to make them more stable