diff --git a/doc/testing.html b/doc/testing.html index f4c45aa63f0..7934a780ce7 100644 --- a/doc/testing.html +++ b/doc/testing.html @@ -191,8 +191,8 @@ TEST FAILURE

Notes for Specific Tests

Docker Tests

Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:

-
$ make test TEST="jtreg:test/hotspot/jtreg/runtime/containers/docker"
+
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker"

To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using JAVA_OPTIONS.

-
$ make test TEST="jtreg:test/hotspot/jtreg/runtime/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"
+
$ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"
diff --git a/doc/testing.md b/doc/testing.md index 6f0a23df4b5..988283a95f2 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -381,12 +381,12 @@ Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86: - $ make test TEST="jtreg:test/hotspot/jtreg/runtime/containers/docker" + $ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using `JAVA_OPTIONS`. - $ make test TEST="jtreg:test/hotspot/jtreg/runtime/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest" + $ make test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest" --- # Override some definitions in the global css file that are not optimal for diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 7e6b7c9a9f8..bd7ea5b95ba 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -79,7 +79,7 @@ gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all # :hotspot_runtime runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all -runtime/containers/docker/TestCPUSets.java 8220672 generic-all +containers/docker/TestCPUSets.java 8220672 generic-all runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 aix-ppc64 ############################################################################# diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 893b49e902a..df6d93919c5 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -43,6 +43,7 @@ hotspot_gc = \ gc \ -gc/nvdimm +# By design this group should include ALL tests under runtime sub-directory hotspot_runtime = \ runtime @@ -65,6 +66,9 @@ hotspot_misc = \ hotspot_native_sanity = \ native_sanity +hotspot_containers = \ + containers + tier1_common = \ sanity/BasicVMTest.java \ gtest/GTestWrapper.java @@ -296,7 +300,6 @@ tier1_runtime = \ -runtime/Thread/CancellableThreadTest.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ - -runtime/containers/ \ sanity/ \ testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java \ -:tier1_runtime_appcds_exclude \ @@ -365,7 +368,6 @@ hotspot_tier2_runtime = \ -runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java \ -runtime/CompressedOops/UseCompressedOops.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ - -runtime/containers/ \ -:tier1_runtime \ -:tier1_serviceability \ -:hotspot_tier2_runtime_platform_agnostic \ @@ -379,7 +381,6 @@ hotspot_tier2_runtime_platform_agnostic = \ hotspot_tier3_runtime = \ runtime/ \ serviceability/ \ - -runtime/containers/ \ -:tier1_runtime \ -:tier1_serviceability \ -:hotspot_tier2_runtime_platform_agnostic \ diff --git a/test/hotspot/jtreg/runtime/containers/cgroup/PlainRead.java b/test/hotspot/jtreg/containers/cgroup/PlainRead.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/cgroup/PlainRead.java rename to test/hotspot/jtreg/containers/cgroup/PlainRead.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/AttemptOOM.java b/test/hotspot/jtreg/containers/docker/AttemptOOM.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/AttemptOOM.java rename to test/hotspot/jtreg/containers/docker/AttemptOOM.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/CheckContainerized.java b/test/hotspot/jtreg/containers/docker/CheckContainerized.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/CheckContainerized.java rename to test/hotspot/jtreg/containers/docker/CheckContainerized.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/DockerBasicTest.java b/test/hotspot/jtreg/containers/docker/DockerBasicTest.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/DockerBasicTest.java rename to test/hotspot/jtreg/containers/docker/DockerBasicTest.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/HelloDocker.java b/test/hotspot/jtreg/containers/docker/HelloDocker.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/HelloDocker.java rename to test/hotspot/jtreg/containers/docker/HelloDocker.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/JfrReporter.java b/test/hotspot/jtreg/containers/docker/JfrReporter.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/JfrReporter.java rename to test/hotspot/jtreg/containers/docker/JfrReporter.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/PrintContainerInfo.java b/test/hotspot/jtreg/containers/docker/PrintContainerInfo.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/PrintContainerInfo.java rename to test/hotspot/jtreg/containers/docker/PrintContainerInfo.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/TEST.properties b/test/hotspot/jtreg/containers/docker/TEST.properties similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/TEST.properties rename to test/hotspot/jtreg/containers/docker/TEST.properties diff --git a/test/hotspot/jtreg/runtime/containers/docker/TestCPUAwareness.java b/test/hotspot/jtreg/containers/docker/TestCPUAwareness.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/TestCPUAwareness.java rename to test/hotspot/jtreg/containers/docker/TestCPUAwareness.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/TestCPUSets.java b/test/hotspot/jtreg/containers/docker/TestCPUSets.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/TestCPUSets.java rename to test/hotspot/jtreg/containers/docker/TestCPUSets.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/TestJFREvents.java b/test/hotspot/jtreg/containers/docker/TestJFREvents.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/TestJFREvents.java rename to test/hotspot/jtreg/containers/docker/TestJFREvents.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/TestMemoryAwareness.java b/test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/TestMemoryAwareness.java rename to test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java diff --git a/test/hotspot/jtreg/runtime/containers/docker/TestMisc.java b/test/hotspot/jtreg/containers/docker/TestMisc.java similarity index 100% rename from test/hotspot/jtreg/runtime/containers/docker/TestMisc.java rename to test/hotspot/jtreg/containers/docker/TestMisc.java diff --git a/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java b/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java index 2bcf9468867..2f5344ef727 100644 --- a/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java +++ b/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java @@ -169,11 +169,17 @@ public class DockerTestUtils { generateDockerFile(buildDir.resolve("Dockerfile"), DockerfileConfig.getBaseImageName(), DockerfileConfig.getBaseImageVersion()); - - // Build the docker - execute(DOCKER_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString()) - .shouldHaveExitValue(0) - .shouldContain("Successfully built"); + try { + // Build the docker + execute(DOCKER_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString()) + .shouldHaveExitValue(0) + .shouldContain("Successfully built"); + } catch (Exception e) { + // If docker image building fails there is a good chance it happens due to environment and/or + // configuration other than product failure. Throw jtreg skipped exception in such case + // instead of failing the test. + throw new SkippedException("Building docker image failed. Details: \n" + e.getMessage()); + } }