mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests
Reviewed-by: lmesnik, dholmes
This commit is contained in:
parent
1f47294cd3
commit
34f241317e
@ -54,9 +54,7 @@ public class DockerBasicTest {
|
||||
testHelloDocker();
|
||||
testJavaVersionWithCgMounts();
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageNameAndTag);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageNameAndTag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -57,9 +57,7 @@ public class ShareTmpDir {
|
||||
try {
|
||||
test();
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -85,9 +85,7 @@ public class TestCPUAwareness {
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,9 +63,7 @@ public class TestLimitsUpdating {
|
||||
try {
|
||||
testLimitUpdates();
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -102,9 +102,7 @@ public class TestMemoryAwareness {
|
||||
testMetricsSwapExceedingPhysical();
|
||||
testContainerMemExceedsPhysical();
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,9 +63,7 @@ public class TestPids {
|
||||
try {
|
||||
testPids();
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -81,9 +81,7 @@ public class TestDockerMemoryMetrics {
|
||||
testMemorySoftLimit("500m","200m");
|
||||
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -53,9 +53,7 @@ public class TestGetFreeSwapSpaceSize {
|
||||
"150M", Integer.toString(0)
|
||||
);
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,9 +62,7 @@ public class TestLimitsUpdating {
|
||||
try {
|
||||
testLimitUpdates();
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -59,9 +59,7 @@ public class TestPidsLimit {
|
||||
testPidsLimit("2000");
|
||||
testPidsLimit("Unlimited");
|
||||
} finally {
|
||||
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
DockerTestUtils.removeDockerImage(imageName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -291,7 +291,9 @@ public class DockerTestUtils {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void removeDockerImage(String imageNameAndTag) throws Exception {
|
||||
if(!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
|
||||
execute(Container.ENGINE_COMMAND, "rmi", "--force", imageNameAndTag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user