mumrah opened a new pull request, #18681: URL: https://github.com/apache/kafka/pull/18681
This patch removes usages of `ignoreFailures` in our CI and changes the XML copy task to a finalizer task instead of doLast closure. Also fixes a fall-through case in junit.py where we did not recognize an error prior to running the tests (such as the javadoc task). ---- Since we are running our CI Gradle commands with `--continue`, we should not normally need to explicitly `ignoreFailures` in the test tasks. After all, that's what `--continue` does (ignore failures from tasks). The reason we included it was to ensure our `doLast` closure was always run. When a test task fails, the main task action will fail and prevent any doLast or other later parts of the task action from running. Instead of copying out the test XML in a doLast, we can use a finalizer task. A finalizer task will run regardless of task outcome. This is a bit nicer than what we were doing. The one case where we need non-standard exit behavior is when running the main test suite on trunk. We may have flaky re-runs of tests which allow the ":test" task to exit normally. However, we do not want to cache the test results if there were flaky failures as this may potentially "hide" flaky tests from our PRs. So far, the only way we have determined to prevent a task from being cached is for it to fail. Here are the possible outcomes of our ":test" task: | Test results | Task result | Gradle exit | junit.py exit | |---|---|---|---| | No failures | 0 | 0 | 0 | | Flaky failures | 1 | 1 | 0 | | Hard failures | 1 | 1 | 1 | | Error (no tests run) | N/A | 1 | 1 | For our ":quarantinedTest" task: | Test results | Task result | Gradle exit | junit.py exit | |---|---|---|---| | No failures | 0 | 0 | 0 | | Flaky failures | 0 | 0 | 0 | | Hard failures | 1 | 1 | 1 | | Error (no tests run) | N/A | 1 | 1 | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org