Skip to content

Commit 34f2413

Browse files
author
SendaoYan
committed
8371503: RETAIN_IMAGE_AFTER_TEST do not work for some tests
Reviewed-by: lmesnik, dholmes
1 parent 1f47294 commit 34f2413

File tree

11 files changed

+12
-30
lines changed

11 files changed

+12
-30
lines changed

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

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

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

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

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

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

8787
} finally {
88-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
89-
DockerTestUtils.removeDockerImage(imageName);
90-
}
88+
DockerTestUtils.removeDockerImage(imageName);
9189
}
9290
}
9391

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
@@ -102,9 +102,7 @@ public static void main(String[] args) throws Exception {
102102
testMetricsSwapExceedingPhysical();
103103
testContainerMemExceedsPhysical();
104104
} finally {
105-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
106-
DockerTestUtils.removeDockerImage(imageName);
107-
}
105+
DockerTestUtils.removeDockerImage(imageName);
108106
}
109107
}
110108

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
@@ -53,9 +53,7 @@ public static void main(String[] args) throws Exception {
5353
"150M", Integer.toString(0)
5454
);
5555
} finally {
56-
if (!DockerTestUtils.RETAIN_IMAGE_AFTER_TEST) {
57-
DockerTestUtils.removeDockerImage(imageName);
58-
}
56+
DockerTestUtils.removeDockerImage(imageName);
5957
}
6058
}
6159

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

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

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)