On Wed, 22 Jul 2026 12:53:20 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).

This pull request has now been integrated.

Changeset: a3dff658
Author:    Arno Zeller <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/a3dff658bbd39aea97ef60508a35bc420dee698d
Stats:     220 lines in 9 files changed: 123 ins; 46 del; 51 mod

8375623: Excessive disk space usage of jpackage and jlink tests in debug builds 
after JDK-8373246

Reviewed-by: clanger

-------------

PR: https://git.openjdk.org/jdk/pull/32009

Reply via email to