From e8e5146bebbdd41e02a7b3493a0f6dc64f95abe3 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 15 Sep 2023 08:34:08 +0100 Subject: [PATCH] Stop failing the build when tests pass after retry Closes gh-37392 --- .../java/org/springframework/boot/build/JavaConventions.java | 2 +- .../springframework/boot/build/ConventionsPluginTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java index 545cae72d6..2298644f60 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java @@ -178,7 +178,7 @@ class JavaConventions { private void configureTestRetries(Test test) { TestRetryExtension testRetry = test.getExtensions().getByType(TestRetryExtension.class); - testRetry.getFailOnPassedAfterRetry().set(true); + testRetry.getFailOnPassedAfterRetry().set(false); testRetry.getMaxRetries().set(isCi() ? 3 : 0); } diff --git a/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java b/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java index 5e15a9c8ef..e7a1ea7356 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java @@ -187,7 +187,7 @@ class ConventionsPluginTests { } assertThat(runGradle(Collections.singletonMap("CI", "true"), "retryConfig", "--stacktrace").getOutput()) .contains("maxRetries: 3") - .contains("failOnPassedAfterRetry: true"); + .contains("failOnPassedAfterRetry: false"); } @Test @@ -209,7 +209,7 @@ class ConventionsPluginTests { } assertThat(runGradle(Collections.singletonMap("CI", "local"), "retryConfig", "--stacktrace").getOutput()) .contains("maxRetries: 0") - .contains("failOnPassedAfterRetry: true"); + .contains("failOnPassedAfterRetry: false"); } private BuildResult runGradle(String... args) {