eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 722 forks source link

jdk_container_0_FAILED jdk/internal/platform/docker/TestDockerCpuMetrics.java NPE at TestDockerCpuMetrics.main(TestDockerCpuMetrics.java:77) #16462

Open JasonFengJ9 opened 1 year ago

JasonFengJ9 commented 1 year ago

Failure link

From an internal build(ub18-aarch64-4):

openjdk version "1.8.0_362"
IBM Semeru Runtime Open Edition (build 1.8.0_362-b05)
Eclipse OpenJ9 VM (build master-7cafd4be8, JRE 1.8.0 Linux aarch64-64-Bit Compressed References 20221210_513 (JIT enabled, AOT enabled)
OpenJ9   - 7cafd4be8
OMR      - 8ae31402f
JCL      - d9472a844 based on jdk8u362-b05)

Rerun in Grinder - Change TARGET to run only the failed test targets.

Optional info

Failure output (captured from console output)

[2022-12-10T07:31:17.409Z] variation: NoOptions
[2022-12-10T07:31:17.409Z] JVM_OPTIONS:  

[2022-12-10T07:44:47.105Z] TEST: jdk/internal/platform/docker/TestDockerCpuMetrics.java

[2022-12-10T07:44:47.107Z] STDERR:
[2022-12-10T07:44:47.107Z] java.lang.NullPointerException
[2022-12-10T07:44:47.107Z]  at TestDockerCpuMetrics.main(TestDockerCpuMetrics.java:77)
[2022-12-10T07:44:47.107Z]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2022-12-10T07:44:47.107Z]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2022-12-10T07:44:47.107Z]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2022-12-10T07:44:47.107Z]  at java.lang.reflect.Method.invoke(Method.java:498)
[2022-12-10T07:44:47.107Z]  at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
[2022-12-10T07:44:47.107Z]  at java.lang.Thread.run(Thread.java:826)
[2022-12-10T07:44:47.107Z] 
[2022-12-10T07:44:47.107Z] JavaTest Message: Test threw exception: java.lang.NullPointerException

jdk_container_jdk8_0_FAILED

100x grinder

pshipton commented 1 year ago

The test seems bogus as it can only run inside a docker environment. The NPE is caused by jdk.internal.platform.Metrics.systemMetrics() returning null. This is expected unless the JVM is running under docker. The test checks if docker is available on the machine, by running docker ps, builds a docker image, runs some tests in the docker image, but then calls Metrics.systemMetrics() outside of the created docker image and expects it to be non-null.

@llxia

pshipton commented 1 year ago

@JasonFengJ9 I expect this should be excluded everywhere it fails until it's working.

JasonFengJ9 commented 1 year ago
 * @summary Test JDK Metrics class when running inside docker container [1]

A docker-enabled machine label is required, this test along with other docker test friends can be excluded if the framework support is going to take a while.

[1] https://github.com/ibmruntimes/openj9-openjdk-jdk8/blob/4d70df27c9b0ea8f58f200cf630ca1332d223fa4/jdk/test/jdk/internal/platform/docker/TestDockerCpuMetrics.java#L35

llxia commented 1 year ago

jdk_container_jdk8 is a newly enabled test in dev.openjdk (see https://github.com/adoptium/aqa-tests/pull/4147). dev.openjdk test build is also new and it sets to run in the docker environment. (i.e., LABEL_ADDITION=sw.tool.docker).

Since they are new, we do not yet have all the data on all versions/platforms. I do not see any valid Test_openjdk8_j9_dev.openjdk_aarch64_linux test builds at Adoptium. But the same test passed on s390 at Adoptium https://ci.adoptopenjdk.net/job/Test_openjdk8_j9_dev.openjdk_s390x_linux/7/

llxia commented 1 year ago

I also noticed the pipeline issue on platforms that do not have sw.tool.docker label (i.e., windows, mac, aix, etc). The pipeline issue is opened at https://github.com/adoptium/ci-jenkins-pipelines/issues/568

JasonFengJ9 commented 1 year ago

JDK17 0.36 build(ub18-aarch64-1)

[2023-01-20T06:19:36.747Z] variation: NoOptions
[2023-01-20T06:19:36.747Z] JVM_OPTIONS: 

[2023-01-20T06:22:28.045Z] TEST: jdk/internal/platform/docker/TestDockerCpuMetrics.java

[2023-01-20T06:22:28.070Z] STDERR:
[2023-01-20T06:22:28.070Z] java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.Metrics.getCpuSetMems()" because the return value of "jdk.internal.platform.Metrics.systemMetrics()" is null
[2023-01-20T06:22:28.070Z]  at TestDockerCpuMetrics.main(TestDockerCpuMetrics.java:82)
[2023-01-20T06:22:28.070Z]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2023-01-20T06:22:28.070Z]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[2023-01-20T06:22:28.070Z]  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2023-01-20T06:22:28.070Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[2023-01-20T06:22:28.070Z]  at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
[2023-01-20T06:22:28.070Z]  at java.base/java.lang.Thread.run(Thread.java:857)
[2023-01-20T06:22:28.070Z] 
[2023-01-20T06:22:28.070Z] JavaTest Message: Test threw exception: java.lang.NullPointerException

[2023-01-20T06:22:47.656Z] jdk_container_0_FAILED