Skip to content

Commit 548035e

Browse files
committed
build: add test retries for CI for flaky test
1 parent 93ea3a0 commit 548035e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'signing'
55
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
66
id 'org.jreleaser' version '1.19.0'
7+
id 'org.gradle.test-retry' version "1.6.2"
78
}
89

910
group 'com.github.gotson'
@@ -43,8 +44,14 @@ dependencies {
4344
testImplementation("org.assertj:assertj-core")
4445
}
4546

47+
boolean isCiServer = System.getenv().containsKey("CI")
4648
test {
4749
useJUnitPlatform()
50+
retry {
51+
if (isCiServer) {
52+
maxRetries = 3
53+
}
54+
}
4855
}
4956

5057
publishing {

0 commit comments

Comments
 (0)