Skip to content

Commit 847c59b

Browse files
author
SendaoYan
committed
8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests
Backport-of: 34f241317ecd7473cfb6dcc2e6e5cf3a40299e2c
1 parent 3bfe497 commit 847c59b

11 files changed

Lines changed: 12 additions & 30 deletions

File tree

test/hotspot/jtreg/containers/docker/DockerBasicTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ public static void main(String[] args) throws Exception {
5555
testHelloDocker();
5656
testJavaVersionWithCgMounts();
5757
} finally {
58-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
59-
DockerTestUtils.removeDockerImage(imageNameAndTag);
60-
}
58+
DockerTestUtils.removeDockerImage(imageNameAndTag);
6159
}
6260
}
6361

test/hotspot/jtreg/containers/docker/ShareTmpDir.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ public static void main(String[] args) throws Exception {
5858
try {
5959
test();
6060
} finally {
61-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
62-
DockerTestUtils.removeDockerImage(imageName);
63-
}
61+
DockerTestUtils.removeDockerImage(imageName);
6462
}
6563
}
6664

test/hotspot/jtreg/containers/docker/TestCPUAwareness.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ public static void main(String[] args) throws Exception {
9090
}
9191

9292
} finally {
93-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
94-
DockerTestUtils.removeDockerImage(imageName);
95-
}
93+
DockerTestUtils.removeDockerImage(imageName);
9694
}
9795
}
9896

test/hotspot/jtreg/containers/docker/TestLimitsUpdating.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ public static void main(String[] args) throws Exception {
6363
try {
6464
testLimitUpdates();
6565
} finally {
66-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
67-
DockerTestUtils.removeDockerImage(imageName);
68-
}
66+
DockerTestUtils.removeDockerImage(imageName);
6967
}
7068
}
7169

test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ public static void main(String[] args) throws Exception {
105105
testMetricsSwapExceedingPhysical();
106106
testContainerMemExceedsPhysical();
107107
} finally {
108-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
109-
DockerTestUtils.removeDockerImage(imageName);
110-
}
108+
DockerTestUtils.removeDockerImage(imageName);
111109
}
112110
}
113111

test/hotspot/jtreg/containers/docker/TestPids.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ public static void main(String[] args) throws Exception {
6363
try {
6464
testPids();
6565
} finally {
66-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
67-
DockerTestUtils.removeDockerImage(imageName);
68-
}
66+
DockerTestUtils.removeDockerImage(imageName);
6967
}
7068
}
7169

test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ public static void main(String[] args) throws Exception {
8181
testMemorySoftLimit("500m","200m");
8282

8383
} finally {
84-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
85-
DockerTestUtils.removeDockerImage(imageName);
86-
}
84+
DockerTestUtils.removeDockerImage(imageName);
8785
}
8886
}
8987

test/jdk/jdk/internal/platform/docker/TestGetFreeSwapSpaceSize.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ public static void main(String[] args) throws Exception {
5252
"150M", Integer.toString(0)
5353
);
5454
} finally {
55-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
56-
DockerTestUtils.removeDockerImage(imageName);
57-
}
55+
DockerTestUtils.removeDockerImage(imageName);
5856
}
5957
}
6058

test/jdk/jdk/internal/platform/docker/TestLimitsUpdating.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ public static void main(String[] args) throws Exception {
6363
try {
6464
testLimitUpdates();
6565
} finally {
66-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
67-
DockerTestUtils.removeDockerImage(imageName);
68-
}
66+
DockerTestUtils.removeDockerImage(imageName);
6967
}
7068
}
7169

test/jdk/jdk/internal/platform/docker/TestPidsLimit.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ public static void main(String[] args) throws Exception {
5959
testPidsLimit("2000");
6060
testPidsLimit("Unlimited");
6161
} finally {
62-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
63-
DockerTestUtils.removeDockerImage(imageName);
64-
}
62+
DockerTestUtils.removeDockerImage(imageName);
6563
}
6664
}
6765

0 commit comments

Comments
 (0)