Avoid final field modification in JUnit5 instrumentation#11752
Avoid final field modification in JUnit5 instrumentation#11752daniel-mohedano wants to merge 1 commit into
Conversation
Test Environment - sbt-scalatestJob Status: 🟢 success
Baseline: median of |
Test Environment - nebula-release-pluginJob Status: 🟢 success
Baseline: median of |
Test Environment - netflix-zuulJob Status: 🟢 success
Baseline: median of |
Test Environment - pass4sJob Status: 🟢 success
Baseline: median of |
Test Environment - reactive-streams-jvmJob Status: 🟢 success
Baseline: median of |
Test Environment - jolokiaJob Status: 🟢 success
Baseline: median of |
Test Environment - okhttpJob Status: 🟢 success
Baseline: median of |
Test Environment - sonar-javaJob Status: 🟢 success
Baseline: median of |
What Does This Do
TestTaskfor every retry, reusing the original parent context, instead of reusing and modifying the original test task. This approach is only supported for versions5.3.1+.TestDescriptorcloning method based onJupiterTestDescriptor#copyIncludingDescendants(UnaryOperator<UniqueId>)}, which also avoids manually setting the generateduniqueIdafter the cloning. This approach is only supported for versions5.13+.Motivation
Avoid failures in future JDKs due to JEP 500: Prepare to Make Final Mean Final.
Additional Notes
Running an example project on JDK26 with
JAVA_TOOL_OPTIONS=--illegal-final-field-mutation=debugproduced the following logs:The build containing the fix doesn't produce the logs.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)Jira ticket: SDTEST-3867