Skip to content

Commit e705e72

Browse files
Gradle check retry (#2638) (#2662)
Add retry plugin support for Test implementations Signed-off-by: Kunal Kotwani <kkotwani@amazon.com> (cherry picked from commit 65cc56e)
1 parent 8865e75 commit e705e72

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

build.gradle

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ plugins {
4949
id 'opensearch.docker-support'
5050
id 'opensearch.global-build-info'
5151
id "com.diffplug.spotless" version "6.3.0" apply false
52+
id "org.gradle.test-retry" version "1.3.1" apply false
5253
}
5354

5455
apply from: 'gradle/build-complete.gradle'
@@ -232,7 +233,7 @@ allprojects {
232233
tasks.withType(JavaCompile).configureEach { JavaCompile compile ->
233234
// See please https://bugs.openjdk.java.net/browse/JDK-8209058
234235
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_11) {
235-
compile.options.compilerArgs << '-Werror'
236+
compile.options.compilerArgs << '-Werror'
236237
}
237238
compile.options.compilerArgs << '-Xlint:auxiliaryclass'
238239
compile.options.compilerArgs << '-Xlint:cast'
@@ -386,6 +387,18 @@ gradle.projectsEvaluated {
386387
}
387388
}
388389

390+
// test retry configuration
391+
subprojects {
392+
apply plugin: "org.gradle.test-retry"
393+
tasks.withType(Test).configureEach {
394+
retry {
395+
failOnPassedAfterRetry = false
396+
maxRetries = 3
397+
maxFailures = 10
398+
}
399+
}
400+
}
401+
389402
// eclipse configuration
390403
allprojects {
391404
apply plugin: 'eclipse'
@@ -445,9 +458,9 @@ allprojects {
445458
tasks.named('eclipse') { dependsOn 'cleanEclipse', 'copyEclipseSettings' }
446459

447460
afterEvaluate {
448-
tasks.findByName("eclipseJdt")?.configure {
449-
dependsOn 'copyEclipseSettings'
450-
}
461+
tasks.findByName("eclipseJdt")?.configure {
462+
dependsOn 'copyEclipseSettings'
463+
}
451464
}
452465
}
453466

0 commit comments

Comments
 (0)