Skip to content

Conversation

@oldium
Copy link
Contributor

@oldium oldium commented Nov 19, 2025

This partly fixes Maven execution in parallel forks, because it postpones evaluating of the rootFolder (user.dir value) until it is really needed during execution. Without the fix the path could be evaluated in the main process, meaning the user.dir is not set correctly to the tested module.

It still does not allow reusing of the forks (reuseForks parameter in maven-surefire-plugin and maven-failsafe-plugin), but at least allows parallel execution (forkCount greater than 1).

When reusing the forks, the SnapshotSystemJUnit5.finishedAllTests() complains that it was called more than once, so the reuseForks has to be disabled (set to false).

This partly fixes #551.

@nedtwigg
Copy link
Member

This partly fixes Maven execution in parallel forks, because it postpones
evaluating of the rootFolder (`user.dir` value) until it is really needed
during execution. Without the fix the path could be evaluated in the main
process, meaning the `user.dir` is not set correctly to the tested module.

It still does not allow reusing of the forks (reuseForks parameter in
maven-surefire-plugin and maven-failsafe-plugin), but at least allows
parallel execution (forkCount greater than 1).

When reusing the forks, the SnapshotSystemJUnit5.finishedAllTests()
complains that it was called more than once, so the reuseForks has to
be disabled (set to false).

This partly fixes diffplug#551.

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
@oldium
Copy link
Contributor Author

oldium commented Nov 20, 2025

Something like this? Sorry my ignorance, I know Java pretty well, but I am Kotlin newbie 😅 (nice language features, though)

@nedtwigg nedtwigg merged commit b555f53 into diffplug:main Nov 22, 2025
3 checks passed
@nedtwigg
Copy link
Member

Perfect! I'll merge and release asap.

@nedtwigg
Copy link
Member

Released in 2.5.5.

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.

junit5 runner doesn't support parallelism via forking

2 participants