From 7828029e7d2a0dc04f1b56afa0e2ebfe69a481a6 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 25 Nov 2022 13:48:43 -0500 Subject: [PATCH] Use BuildParams.isCi() instead of checking env var (#5368) (#5375) Signed-off-by: Andrew Ross Signed-off-by: Andrew Ross Signed-off-by: Andriy Redko Signed-off-by: Andrew Ross Signed-off-by: Andriy Redko Co-authored-by: Andrew Ross --- build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.gradle b/build.gradle index e2fc923b98e7a..682b26ca4fed5 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,7 @@ plugins { id 'opensearch.docker-support' id 'opensearch.global-build-info' id "com.diffplug.spotless" version "6.3.0" apply false + id "org.gradle.test-retry" version "1.4.1" apply false } apply from: 'gradle/build-complete.gradle' @@ -382,6 +383,20 @@ gradle.projectsEvaluated { } } +// test retry configuration +subprojects { + apply plugin: "org.gradle.test-retry" + tasks.withType(Test).configureEach { + retry { + if (BuildParams.isCi()) { + maxRetries = 3 + maxFailures = 10 + } + failOnPassedAfterRetry = false + } + } +} + // eclipse configuration allprojects { apply plugin: 'eclipse'