Skip to content

Commit

Permalink
refactor: rename variable
Browse files Browse the repository at this point in the history
* The meaning of the name "retryFailOnPassedAfterRetry" was difficult to understand. It causes the full test run to fail when a flaky test is detected (both passes and fails on multiple runs).
* Seems the indirection is required, first setting and checking a variable, then setting the "failOnPassedAfterRetry" property used by the retry plugin.
  • Loading branch information
swalchemist committed Oct 14, 2023
1 parent 9610f2c commit cb2d41f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ subprojects {
jvmArgs += ["-Xmx1024m", "-XX:+StartAttachListener", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/var/log/uaa-tests.hprof"]

retry {
def retryFailOnPassedAfterRetry = Boolean.parseBoolean(
def failOnPassedAfterRetrySystemProperty = Boolean.parseBoolean(
System.getProperty("failOnPassedAfterRetry", "false"));
if (!retryFailOnPassedAfterRetry)
if (!failOnPassedAfterRetrySystemProperty)
logger.warn("retry: Flaky tests will not make the test run fail because failOnPassedAfterRetry is false.")

failOnPassedAfterRetry = retryFailOnPassedAfterRetry
// Configure the retry extension
failOnPassedAfterRetry = failOnPassedAfterRetrySystemProperty
maxFailures = Integer.parseInt(System.getProperty("maxFailures", "3"))
maxRetries = Integer.parseInt(System.getProperty("maxRetries", "1"))
}
Expand Down

0 comments on commit cb2d41f

Please sign in to comment.