Skip to content

Migrate surefire-its fixture from maven-verifier to maven-executor - #3484

Merged
slachiewicz merged 4 commits into
masterfrom
agent/maven-executor-migration
Sep 28, 2026
Merged

slachiewicz merged 4 commits into
masterfrom
agent/maven-executor-migration

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

maven-verifier is deprecated (apache/maven-verifier#186); this replaces the surefire-its fixture's Verifier wrapper with one built on org.apache.maven.executor:maven-executor:1.0.0. A single JVM-lifetime ExecutorHelper wraps a static EmbeddedMavenExecutor/ForkedMavenExecutor, since a fresh EmbeddedMavenExecutor per execution builds a new Maven ClassWorld that close() does not release (apache/maven-executor#46); stdout and stderr share one sink so the log file preserves arrival order.

Supersedes the MavenLauncher change 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.

maven-verifier is deprecated (apache/maven-verifier#186)
Embedded mode now works on Maven 4, so the forced fork in MavenLauncher is not needed
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
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
slachiewicz merged commit c0530ae into master Sep 28, 2026
19 checks passed
@slachiewicz
slachiewicz deleted the agent/maven-executor-migration branch September 28, 2026 19:16
@github-actions github-actions Bot added this to the 3.6.1 milestone Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant