Skip to content

Introduce experimental memory cleanup mode#5588

Merged
mpkorstanje merged 13 commits intomainfrom
marc/test-plan-memory-optimization
Apr 14, 2026
Merged

Introduce experimental memory cleanup mode#5588
mpkorstanje merged 13 commits intomainfrom
marc/test-plan-memory-optimization

Conversation

@marcphilipp
Copy link
Copy Markdown
Member

@marcphilipp marcphilipp commented Apr 7, 2026

Issue: #5344


Definition of Done

@mpkorstanje
Copy link
Copy Markdown
Contributor

mpkorstanje commented Apr 7, 2026

    public static void main(String[] args) {
        SummaryGeneratingListener listener = new SummaryGeneratingListener();
        LauncherFactory.create()
                .execute(LauncherDiscoveryRequestBuilder.discoveryRequest()
                        .selectors(DiscoverySelectors.selectClass(RunCucumberTest.class))
                        .build(), listener);

        listener.getSummary()
                .printFailuresTo(new PrintWriter(System.out));
    }
Exception in thread "main" org.junit.platform.commons.PreconditionViolationException: No TestIdentifier with unique ID [[engine:junit-platform-suite]/[suite:com.example.project.RunCucumberTest]/[engine:cucumber]/[feature:classpath%3Acom%2Fexample%2Fproject%2Fbelly.feature]] has been added to this TestPlan.
	at org.junit.platform.commons.util.Preconditions.condition(Preconditions.java:389)
	at org.junit.platform.commons.util.Preconditions.notNull(Preconditions.java:74)
	at org.junit.platform.launcher.TestPlan.getTestIdentifier(TestPlan.java:212)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.junit.platform.launcher.TestPlan.getParent(TestPlan.java:155)
	at org.junit.platform.launcher.listeners.MutableTestExecutionSummary.collectTestDescription(MutableTestExecutionSummary.java:229)
	at org.junit.platform.launcher.listeners.MutableTestExecutionSummary.describeTest(MutableTestExecutionSummary.java:223)
	at org.junit.platform.launcher.listeners.MutableTestExecutionSummary.lambda$printFailuresTo$0(MutableTestExecutionSummary.java:207)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2361)
	at org.junit.platform.launcher.listeners.MutableTestExecutionSummary.printFailuresTo(MutableTestExecutionSummary.java:206)
	at org.junit.platform.launcher.listeners.MutableTestExecutionSummary.printFailuresTo(MutableTestExecutionSummary.java:196)
	at com.example.project.RunCucumberTest.main(RunCucumberTest.java:36)

edit: Likewise

    public static void main(String[] args) throws IOException {
        ConsoleLauncher.main("execute", "--select-package", "com.example.project");
    }

But at least the tree summary works. 😄

╷
├─ Cucumber ✔
│  └─ Belly ✔
│     └─ a few cukes ✘ T
└─ JUnit Platform Suite ✔
   └─ RunCucumberTest ✔
      └─ Cucumber ✔
         └─ Belly ✔
            └─ a few cukes ✘ T

Failures (2):
No TestIdentifier with unique ID [[engine:cucumber]/[feature:classpath%3Acom%2Fexample%2Fproject%2Fbelly.feature]] has been added to this TestPlan.

Comment thread junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java Outdated
@marcphilipp
Copy link
Copy Markdown
Member Author

@mpkorstanje I pushed 48f77bb to fix the exception reported above.

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@marcphilipp marcphilipp modified the milestone: 6.1.0-M2 Apr 10, 2026
@marcphilipp marcphilipp marked this pull request as ready for review April 10, 2026 15:10
@testlens-app

This comment has been minimized.

@testlens-app
Copy link
Copy Markdown

testlens-app bot commented Apr 10, 2026

✅ All tests passed ✅

🏷️ Commit: 3c0b0e7
▶️ Tests: 750 executed
⚪️ Checks: 15/15 completed


Learn more about TestLens at testlens.app.

@marcphilipp marcphilipp requested a review from mpkorstanje April 11, 2026 09:28
@mpkorstanje mpkorstanje merged commit 795d3d4 into main Apr 14, 2026
18 checks passed
@mpkorstanje mpkorstanje deleted the marc/test-plan-memory-optimization branch April 14, 2026 22:30
@marcphilipp marcphilipp linked an issue Apr 15, 2026 that may be closed by this pull request
@marcphilipp marcphilipp removed this from the 6.1.0-RC1 milestone Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestPlan can itself lead to excessive memory usage

3 participants