Repository navigation
Migrate surefire-its fixture from maven-verifier to maven-executor - #3484
Merged
Merged
Conversation
maven-verifier is deprecated (apache/maven-verifier#186) Embedded mode now works on Maven 4, so the forced fork in MavenLauncher is not needed
slachiewicz
force-pushed
the
agent/maven-executor-migration
branch
from
September 21, 2026 11:05
f4b8be8 to
783bade
Compare
This was referenced Sep 21, 2026
EmbeddedMavenExecutor snapshots and restores System properties around each embedded run, so a JVM-lifetime ExecutorHelper reset properties set between execute() calls; create and close one per invocation instead. stdout/stderr now share one sink so the log file preserves arrival order, as the old Verifier did. Also drops the unused settingsFile/debug constructor parameters: settings.xml -based local-repo detection was never applied to the build itself (apache/maven-verifier#142).
slachiewicz
marked this pull request as ready for review
September 21, 2026 11:38
A new EmbeddedMavenExecutor per execute() builds a new Maven ClassWorld that close() does not release, so hundreds of ITs in one JVM exhausted heap on CI. Go back to a single JVM-lifetime ExecutorHelper.forExecutors() wrapping a static EmbeddedMavenExecutor and ForkedMavenExecutor, as apache/maven master's maven-it-helper Verifier does. The trade-off is that system properties set between two execute() calls are reset by the embedded executor's own snapshot/restore (see apache/maven-executor#46).
EmbeddedMavenExecutor wraps stdout/stderr in a PrintStream with no explicit
charset, so it encodes with Charset.defaultCharset() -- on Windows JDK 8/11/17
that's the ANSI codepage, not UTF-8. loadFile()/getLogContents() decoded with a
hardcoded UTF_8, so any non-ASCII byte the child build printed threw
MalformedInputException. Confirmed against run 35599180531's failure artifact:
ConsoleOutputIT's log.txt contains 'failing with' + 0xFC ('ü'), invalid as
UTF-8 but clean as windows-1252.
slachiewicz
requested review from
cstamas,
michael-o,
olamy and
slawekjaranowski
September 21, 2026 18:02
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.
maven-verifier is deprecated (apache/maven-verifier#186); this replaces the surefire-its fixture's
Verifierwrapper with one built onorg.apache.maven.executor:maven-executor:1.0.0. A single JVM-lifetimeExecutorHelperwraps a staticEmbeddedMavenExecutor/ForkedMavenExecutor, since a freshEmbeddedMavenExecutorper execution builds a new Maven ClassWorld thatclose()does not release (apache/maven-executor#46); stdout and stderr share one sink so the log file preserves arrival order.Supersedes the
MavenLauncherchange in #3448.maven-executor's embedded launcher handles Maven 4 correctly, so the forced-fork workaround for Maven 4 embedded execution is not needed. Settings-file-based local-repo detection is dropped: it was never applied to the build itself (apache/maven-verifier#142).Verified:
mvn -B -pl surefire-its verify -Prun-its -Dit.test='Surefire1602IT,WorkingDirectoryIT,JUnit4PlatformEnginesIT,Surefire772NoFailsafeReportsIT,MultiModuleProjectWithJPMSIT'→ 83 tests, 0 failures.