Repository navigation
[SUREFIRE-2148] Verify recovered BeforeAll does not fail build - #3419
Merged
Merged
Conversation
Add a focused JUnit Platform integration test where BeforeAll fails once and succeeds on the only retry. Assert the successful Maven exit and the resulting flaky report. Fixes apache#2749
|
@olamy Please assign appropriate label to PR according to the type of change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following this checklist to help us incorporate your
contribution quickly and easily:
mvn clean installto make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean install).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.
Summary
Fixes #2749.
The production behavior was corrected by #3200 and released in Surefire 3.5.5, but its integration test combines a recovered
@BeforeAllfailure with a class that always fails. Because that test expects the overall Maven invocation to fail, it does not protect the original SUREFIRE-2148 requirement: a build must succeed when the only setup failure passes on rerun.This adds a focused JUnit Platform fixture whose
@BeforeAllfails once and succeeds on the only retry. The integration test requires a successful Maven exit, verifies the lifecycle failure is reported as a flake followed byRun 2: PASS, and asserts the final report contains no errors or failures.User impact
There is no production-code change. The existing fix is now covered against regressions that would incorrectly fail a build after a recovered
@BeforeAllerror.Tests
nice -n 10 env JAVA_HOME=/opt/jdks/latest-17 /opt/maven/latest/bin/mvn clean install -Dmaven.build.cache.enabled=false(17 modules, build success)nice -n 10 env JAVA_HOME=/opt/jdks/latest-17 /opt/maven/latest/bin/mvn -Prun-its clean install -Dmaven.build.cache.enabled=false(762 integration tests, 0 failures, 0 errors, 153 skipped)3.6.0-M2-SNAPSHOT(first@BeforeAllrun errors, retry passes, one flake, build success)