wilx opened a new pull request, #3420:
URL: https://github.com/apache/maven-surefire/pull/3420
## Summary
- pass the effective `java.io.tmpdir` to the forked JVM on its command line
- make startup system properties an explicit part of the
`ForkConfiguration#createCommandLine` contract
- add unit coverage for JVM argument ordering and an integration test using
JUnit Jupiter's `@TempDir`
## Why
Surefire normally transfers configured system properties to `ForkedBooter`
through a properties file. On newer JDKs, NIO caches the default temporary
directory during JVM initialization, before `ForkedBooter` can apply those
properties. As a result, `System.getProperty("java.io.tmpdir")` reported the
configured value while JUnit's `@TempDir` still used the JVM's original
temporary directory.
Passing `java.io.tmpdir` as a JVM startup argument ensures that the JDK
initializes its cached temporary-directory value correctly. The change is in
the shared fork-launching code and therefore applies to both Surefire and
Failsafe.
## Validation
- `mvn clean install` passed across all 17 reactor modules on JDK 17
- `mvn -Prun-its clean install` passed; `surefire-its` ran 762 tests with no
failures or errors
- `Surefire2113TempDirIT` passed as part of the full integration-test suite
Following this checklist to help us incorporate your
contribution quickly and easily:
- [x] Each commit in the pull request should have a meaningful subject line
and body.
- [x] Write a pull request description that is detailed enough to
understand what the pull request does, how, and why.
- [x] Run `mvn clean install` to make sure basic checks pass. A more
thorough check will
be performed on your pull request automatically.
- [x] You have run the integration tests successfully (`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](https://www.apache.org/licenses/icla.pdf) 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](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [x] I hereby declare this contribution to be licenced under the [Apache
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]