Retry tests in CI (#7106)

This commit is contained in:
jack-berg 2025-02-18 09:58:58 -06:00 committed by GitHub
parent 3d3355305b
commit fe73fb737a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,7 @@ dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
// Needed for japicmp but not automatically brought in for some reason.
implementation("com.google.guava:guava:33.4.0-jre")
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:3.19.1")
implementation("com.squareup:javapoet:1.13.0")
implementation("com.squareup.wire:wire-compiler")
implementation("com.squareup.wire:wire-gradle-plugin")

View File

@ -113,6 +113,14 @@ tasks {
)
}
val defaultMaxRetries = if (System.getenv().containsKey("CI")) 2 else 0
val maxTestRetries = gradle.startParameter.projectProperties["maxTestRetries"]?.toInt() ?: defaultMaxRetries
develocity.testRetry {
// You can see tests that were retried by this mechanism in the collected test reports and build scans.
maxRetries.set(maxTestRetries);
}
testLogging {
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true