On Tue, 28 Jul 2026 12:31:08 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:
> 
>   Revert copyright updates from files that have no other changes

That's fine. One minor remark.

test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java line 55:

> 53:  * @bug 8252919 8327499
> 54:  * @library ../../lib
> 55:  * @library /test/lib

Could be done in one line, like `* @library ../../lib /test/lib`, no?

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

Changes requested by clanger (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/32009#pullrequestreview-4797977524
PR Review Comment: https://git.openjdk.org/jdk/pull/32009#discussion_r3666083249

Reply via email to