[SUREFIRE-1639] Add ability to configure JUnit 5 TestExecutionListener - #3438
Merged
olamy merged 1 commit intoAug 21, 2026
Merged
Conversation
pan3793
force-pushed
the
SUREFIRE-1639-test-execution-listener
branch
from
August 19, 2026 08:13
ab49f0f to
c7a3973
Compare
6 tasks
joseluisll
added a commit
to joseluisll/hadoop
that referenced
this pull request
Aug 19, 2026
GenericTestUtils.waitFor dumps all threads with deadlock analysis to stderr at the moment the wait expires. Its TimeoutException message drops from ~16KB to one line. Sample failure report: 18,223 -> 1,642 bytes. TimedOutTestsListener implements TestExecutionListener. The `listener` provider property the eight poms already carry binds to it once the JUnit Platform provider accepts platform listeners (SUREFIRE-1639, apache/maven-surefire#3438). Dormant until then. No pom is touched. - -Dhadoop.test.timedout.dump=false disables dumps. - -Dhadoop.test.timedout.dump.limit (default 5) caps them per JVM, with one elision notice. Both entry points share the budget. - The exception records "Thread dump printed to stderr." only when a dump was printed. - The two checkstyle violations the 2012 test file carried are fixed. Not covered: Surefire's fork kill at forkedProcessTimeoutInSeconds (Shutdown.KILL -> Runtime.halt()). HADOOP-19950 captures those reports. Release note: waitFor's TimeoutException message no longer carries the thread dump. Tests: TestTimedOutTestsListener covers timeout detection, the off switch, the dump limit, dumpForTimeout's return value, and waitFor's exact message in all three states — dump printed, dumps off, budget spent, driving the real waitFor. TestGenericTestUtils passes unchanged. Contains content generated by Claude Code.
Member
Author
|
the test failure looks to be caused by a transient network issue |
The listener provider property now accepts JUnit Platform TestExecutionListener classes in addition to JUnit 4 RunListener classes. Each comma-separated entry is trimmed and empty entries are ignored.
pan3793
force-pushed
the
SUREFIRE-1639-test-execution-listener
branch
from
August 20, 2026 12:28
c7a3973 to
d8e2164
Compare
Member
Author
|
@olamy could you please take a look at this one too? thank you in advance |
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.
Issue: #2122
Description
The
listenerprovider property now accepts JUnit PlatformTestExecutionListenerclasses in addition to JUnit 4org.junit.runner.notification.RunListenerclasses.For each comma-separated entry, whitespace is trimmed and empty entries are
ignored. The provider then tries, in order:
TestExecutionListener(instantiated directly and registeredwith the
Launcher)RunListener(wrapped inJUnit4ListenersAdapter)TestNG engine via
testng.listeners)Changes
JUnitPlatformProviderresolves eachlistenerentry as a JUnit PlatformTestExecutionListeneror a JUnit 4RunListener, trimming whitespace andskipping empty entries.
Registering a custom TestExecutionListenersection inmaven-surefire-plugin/src/site/markdown/examples/junit-platform.md.vm.testExecutionListenerIsConfiguredViaListenerPropertyand thejunit5-testexecutionlistenerintegration test withJUnit5TestExecutionListenerIT.How it was tested
mvn -pl surefire-providers/surefire-junit-platform test -Dtest=JUnitPlatformProviderTest- 48 tests passmvn -pl surefire-providers/surefire-junit-platform checkstyle:check-no violations
JUnit5TestExecutionListenerITverifies end-to-end thatthe configured listener runs in a forked test JVM
Checklist
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.
(I'm committer of other Apache projects and have already signed the ICLA)