On Mon, 15 Dec 2025 05:28:03 GMT, David Holmes <[email protected]> wrote:
>> Hi all,
>>
>> The DockerTestUtils.RETAIN_IMAGE_AFTER_TEST variable which read the property
>> from "jdk.test.docker.retain.image" do not work for some of the docker
>> tests, such as jdk/internal/platform/docker/TestDockerCpuMetrics.java, only
>> works for some of the docker tests, such as
>> jdk/internal/platform/docker/TestPidsLimit.java.
>>
>> This PR read the DockerTestUtils.RETAIN_IMAGE_AFTER_TEST inside function
>> removeDockerImage instead of before all the fucntion removeDockerImage. This
>> will make all the docker tests receive the property
>> jdk.test.docker.retain.image.
>>
>> Change has been verified locally on linux-x64 by run the all touched tests.
>
> test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java line 255:
>
>> 253: if(!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
>> 254: execute(Container.ENGINE_COMMAND, "rmi", "--force",
>> imageNameAndTag);
>> 255: }
>
> Pre-existing but indent is too big
You also need to document the fact the property is used to make this a no-op.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28208#discussion_r2617999664