Use Retry.Mode.SETUP_FEATURE_CLEANUP to improve Elasticsearch test flakiness (DataDog/dd-trace-java#1494)
MODIFY
gradle/java.gradle
gradle/java.gradle
@@ -119,7 +119,6 @@ dependencies {
testCompile deps.groovy
testCompile deps.testLogging
testCompile group: 'info.solidsoft.spock', name: 'spock-global-unroll', version: '0.5.1'
- testCompile group: 'com.anotherchrisberry', name: 'spock-retry', version: '0.6.4'
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.19.0'
}

MODIFY
instrumentation/elasticsearch/elasticsearch-transport-2.0/src/latestDepTest/groovy/springdata/Elasticsearch2SpringRepositoryTest.groovy
instrumentation/elasticsearch/elasticsearch-transport-2.0/src/latestDepTest/groovy/springdata/Elasticsearch2SpringRepositoryTest.groovy
@@ -32,6 +32,7 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
DocRepository repo = applicationContext.getBean(DocRepository)
def setup() {
+ repo.refresh()
TEST_WRITER.clear()
runUnderTrace("delete") {
repo.deleteAll()

MODIFY
instrumentation/elasticsearch/elasticsearch-transport-2.0/src/test/groovy/springdata/Elasticsearch2SpringRepositoryTest.groovy
instrumentation/elasticsearch/elasticsearch-transport-2.0/src/test/groovy/springdata/Elasticsearch2SpringRepositoryTest.groovy
@@ -33,6 +33,7 @@ class Elasticsearch2SpringRepositoryTest extends AgentTestRunner {
DocRepository repo = applicationContext.getBean(DocRepository)
def setup() {
+ repo.refresh()
TEST_WRITER.clear()
runUnderTrace("delete") {
repo.deleteAll()

MODIFY
instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy
instrumentation/elasticsearch/elasticsearch-transport-5.3/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy
@@ -61,6 +61,7 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner {
}
def setup() {
+ repo.refresh()
TEST_WRITER.clear()
runUnderTrace("delete") {
repo.deleteAll()

Use Retry.Mode.SETUP_FEATURE_CLEANUP to improve Elasticsearch test flakiness (DataDog/dd-trace-java#1494)