From 0c2877f5702d4b945ed4cba823cae4efc5bdd553 Mon Sep 17 00:00:00 2001 From: Amit Galitzky Date: Tue, 22 Mar 2022 22:33:18 +0000 Subject: [PATCH] adding retry failed test to gradle Signed-off-by: Amit Galitzky --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 58ac63aa7..a8500b5c3 100644 --- a/build.gradle +++ b/build.gradle @@ -39,6 +39,7 @@ plugins { id 'nebula.ospackage' version "8.3.0" apply false id "com.diffplug.gradle.spotless" version "3.26.1" id 'java-library' + id 'org.gradle.test-retry' version '1.0.0' } tasks.withType(JavaCompile) { @@ -150,6 +151,11 @@ def opensearch_tmp_dir = rootProject.file('build/private/opensearch_tmp').absolu opensearch_tmp_dir.mkdirs() test { + retry { + failOnPassedAfterRetry = false + maxFailures = 10 + maxRetries = 10 + } include '**/*Tests.class' systemProperty 'tests.security.manager', 'false' } @@ -162,6 +168,11 @@ task integTest(type: RestIntegTestTask) { tasks.named("check").configure { dependsOn(integTest) } integTest { + retry { + failOnPassedAfterRetry = false + maxFailures = 10 + maxRetries = 10 + } dependsOn "bundlePlugin" systemProperty 'tests.security.manager', 'false' systemProperty 'java.io.tmpdir', opensearch_tmp_dir.absolutePath