diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de08cbe49f..1795d017f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: - opendistro-* env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 + GRADLE_OPTS: -Dhttp.keepAlive=false -DCI=true jobs: build: diff --git a/build.gradle b/build.gradle index dd5cf8b7f7..89f86a979e 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ plugins { id "nebula.ospackage" version "9.0.0" id "com.google.osdetector" version "1.7.0" + id "org.gradle.test-retry" version "1.3.1" } import org.gradle.crypto.checksum.Checksum @@ -211,13 +212,17 @@ testsJar { libsDirName = '.' } +boolean isCI = System.getenv().containsKey("CI") + test { maxParallelForks = 3 jvmArgs "-Xmx3072m" retry { - failOnPassedAfterRetry = false - maxFailures = 30 - maxRetries = 3 + if (isCI) { + failOnPassedAfterRetry = false + maxFailures = 30 + maxRetries = 3 + } } }