RFR: 8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests

SendaoYan syan at openjdk.org
Sat Nov 8 08:17:39 UTC 2025


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.

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

Commit messages:
 - 8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests

Changes: https://git.openjdk.org/jdk/pull/28208/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28208&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371503
  Stats: 39 lines in 11 files changed: 2 ins; 20 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/28208.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28208/head:pull/28208

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


More information about the core-libs-dev mailing list