fix(QTDI-2284): fix junit resources cleanup#1179
Open
Conversation
thboileau
commented
Mar 11, 2026
...ponent-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java
Outdated
Show resolved
Hide resolved
thboileau
commented
Mar 11, 2026
...ponent-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR aims to fix JUnit-related resource cleanup in component-runtime-junit, making the embedded component manager shutdown safer (notably when closed multiple times) and adding a regression test.
Changes:
- Bump the project’s JUnit 5 version property.
- Update
BaseComponentsHandlercleanup logic (centralize JSON-B close and avoid NPE on repeatedclose()calls). - Add a unit test validating that the embedded manager can be closed twice without leaving state behind.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
pom.xml |
Updates the JUnit 5 version property used across the build. |
component-runtime-testing/component-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java |
Makes embedded manager cleanup more robust; adds State.cleanUp() and adjusts shutdown behavior; minor doc/formatting tweaks. |
component-runtime-testing/component-runtime-junit/src/main/java/org/talend/sdk/component/junit5/ComponentExtension.java |
Minor Javadoc grammar fix. |
component-runtime-testing/component-runtime-junit/src/test/java/org/talend/sdk/component/junit/BaseComponentHandlerTest.java |
Adds regression coverage for double-close behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ent-runtime-junit/src/test/java/org/talend/sdk/component/junit/BaseComponentHandlerTest.java
Outdated
Show resolved
Hide resolved
...ent-runtime-junit/src/test/java/org/talend/sdk/component/junit/BaseComponentHandlerTest.java
Outdated
Show resolved
Hide resolved
...ponent-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java
Outdated
Show resolved
Hide resolved
...ponent-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java
Show resolved
Hide resolved
...ent-runtime-junit/src/test/java/org/talend/sdk/component/junit/BaseComponentHandlerTest.java
Outdated
Show resolved
Hide resolved
thboileau
commented
Mar 11, 2026
...ponent-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ypiel-talend
previously approved these changes
Mar 12, 2026
...ponent-runtime-junit/src/main/java/org/talend/sdk/component/junit/BaseComponentsHandler.java
Outdated
Show resolved
Hide resolved
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.
Requirements
Why this PR is needed?
What does this PR adds (design/code thoughts)?