Skip to content

Allow excluding engines from memory cleanup mode#5786

Open
marcphilipp wants to merge 1 commit into
mainfrom
marc/memory-cleanup-exclusions
Open

Allow excluding engines from memory cleanup mode#5786
marcphilipp wants to merge 1 commit into
mainfrom
marc/memory-cleanup-exclusions

Conversation

@marcphilipp

Copy link
Copy Markdown
Member

The new junit.platform.execution.memory.cleanup.engines.excluded
configuration parameter can be used to specify a comma-separated list of
engine ids that should be excluded from having their TestDescriptors
removed in case memory cleanup mode is enabled. This can be used to
work around problems with engines that required their descriptors to
remain in the test tree during execution or in case their removal
operation is slow/expensive.

Resolves #5740.

The new `junit.platform.execution.memory.cleanup.engines.excluded`
configuration parameter can be used to specify a comma-separated list of
engine ids that should be excluded from having their `TestDescriptors`
removed in case memory cleanup mode is enabled. This can be used to
work around problems with engines that required their descriptors to
remain in the test tree during execution or in case their removal
operation is slow/expensive.

Resolves #5740.
@testlens-app

This comment has been minimized.

* {@return whether this segment is of type <em>engine</em>}
*/
@API(status = EXPERIMENTAL, since = "6.1.1")
public boolean hasEngineType() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming nitpick, has or is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A segment consists of a type and a value. In other words, a segment has a type and a value. isEngineType and isOfTypeEngine sounded "wrong" to me. Do you have concrete suggestions that are better?

@mpkorstanje mpkorstanje Jun 22, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For UniqueId we have methods named forEngine, appendEngine and getEngineId. So it seems that a segment that has the engine type is an engine segment. This would suggest .isEngine() is accurate.

Elsewhere, test descriptor without a parent is the root descriptor, which can be checked with .isRoot() so .isEngine() would be consistent with that too.

Finally, I get the impression that we intentionally hiding the fact that engine segments use ENGINE_SEGMENT_TYPE and .hasEngineType() leaks that that implementation detail while .isEngine() does not.

@marcphilipp marcphilipp requested a review from mpkorstanje June 22, 2026 14:56
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.

Enabling memory cleanup mode causes performance issue with JUnit 3.x tests executed by Vintage engine

3 participants