bioformats icon indicating copy to clipboard operation
bioformats copied to clipboard

Turn off file-leak-detector if tests are run with Java 21

Open melissalinkert opened this issue 1 year ago • 2 comments

See discussion in #4158.

Not sure if there is a better way to do this (in particular, to exclude >= 21), but this should at least allow tests to run on Java 21 for now.

melissalinkert avatar Mar 01 '24 21:03 melissalinkert

Discussed earlier today with @dgault and @melissalinkert, the current proposal offers a good compromise allowing to run the non-regression repository tests on JDK 21 without dropping support for JDK 8 yet and still testing file leaks.
To facilitate debugging and identification of the JDK used in a test run, we might want to update FormatReaderTestFactory.createInstances to also print the Java version as an INFO level statement.

sbesson avatar Mar 04 '24 20:03 sbesson

Java version should now be logged each time tests are run.

As suggested by @dgault, fafc56b picks a different file-leak-detector version based on the JDK version being used. The Ant build changes have been reverted so that file-leak-detector remains enabled. That seems to work locally - I can now both compile and run tests on both 8 and 21. Assuming it also works in the next 4 nightly builds in which it's included, that was easier than I expected and worth considering in the context of https://github.com/ome/ome-common-java/pull/72.

melissalinkert avatar Mar 05 '24 00:03 melissalinkert