jenkinsci / lib-file-leak-detector

Java agent that detects file handle leak
http://file-leak-detector.kohsuke.org/
MIT License
241 stars 112 forks source link

Add Java 17 to build/test matrix #83

Closed basil closed 2 years ago

basil commented 2 years ago

The recently-added AgentMainTest fails when run with Java 17. This can be reproduced locally by running mvn clean verify -Dtest=org.kohsuke.file_leak_detector.AgentMainTest with Java 17.

@centic9 Are you interested in taking a look at this? There is no rush to add Java 17 support, but I have been going through and adding Java 17 to the build/test matrix for all Jenkins core components, so it would be nice to get this one crossed off the list.

centic9 commented 2 years ago

The Socket-implementation seems to have changed a lot in Java 17, so likely file-leak detection for it would need a complete re-write for JDK 17 which is likely above what I can do.

For now we could disable support for Socket on Java 17 to allow to test for the other types of file-handle leaks.

basil commented 2 years ago

Sounds fine to me. If you're interested in submitting a patch that disables support for socket on Java 17 and passes mvn clean verify, I'd be happy to incorporate it into this PR. No pressure though.

centic9 commented 2 years ago

I created #84, it does not check for the actual Java version, but rather gracefully degrades if Socket-support is not possible.