On Wed, 22 Jul 2026 14:00:24 GMT, Arno Zeller <[email protected]> wrote:
>> **Reduce disk usage in jlink tests** >> >> Several jlink tests accumulate large image directories on disk without >> cleaning them up, causing significant disk space usage - especially in >> fastdebug builds where images include big native debug symbols. This change >> addresses that in three ways: >> >> Image size reduction: >> Added `--strip-debug` to jlink invocations in ~30 test files where it is >> safe to do so (i.e. the test only checks functional correctness - module >> presence, exit codes, stdout but not further things like binary equality). >> Tests that compare images byte-for-byte `(JLinkReproducible*, >> PackagedModulesVsRuntimeImageLinkTest`) are unchanged. >> >> Per-test cleanup: >> Added `@AfterEach/@AfterMethod` cleanup to JUnit 5 and TestNG tests that >> create multiple images (`IncludeLocalesPluginTest, >> GenerateJLIClassesPluginTest, LegalFilePluginTest, >> ExcludeJmodSectionPluginTest, UserModuleTest and JLinkTest`). This reduce >> disk pressure by deleting no longer needed images. >> >> Intermediate image cleanup in `AbstractLinkableRuntimeTest` tests: >> `AbstractLinkableRuntimeTest.createJavaImageRuntimeLink()` now deletes the >> intermediate linkable-runtime JDK image immediately after it has been used >> to produce the final output image. And `createRuntimeLinkImage()` deletes >> the --generate-linkable-runtime temporary image as soon as it has been >> copied. This reduces peak disk usage in JavaSEReproducibleTest and other >> `AbstractLinkableRuntimeTest` subclasses from 6 simultaneous images to 2. >> `JLinkReproducible2Test` and `JLinkReproducible3Test` also sequence their >> image pairs so at most one pair exists at a time. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Arno Zeller has updated the pull request incrementally with one additional > commit since the last revision: > > Update copyright I think it's okay to have tests remove/cleanup so they don't leave large runtime images on the file system. Does your work really need all these tests changed to use --strip-debug? I realize this may be something in your environment with external debug symbols but it just begs questions from anyone that touches these tests in the future. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32009#issuecomment-5047123894
