RFR: 8341310: Test containers/docker/TestJcmdWithSideCar.java fails after JDK-8327114

Sebastian Lövdahl duke at openjdk.org
Wed Oct 2 10:25:34 UTC 2024


On Tue, 1 Oct 2024 16:23:41 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> PTAL @slovdahl Thanks!

@jerboaa Thanks a lot for the thorough investigation here!

I was also able to reproduce the failure locally on my Ubuntu 24.04 using `podman` (that runs containers as a regular user):


sudo apt install podman
make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=podman"

...

STDERR:
java.lang.RuntimeException: ACCESS_TMP_VIA_PROC_ROOT: Could not find specified process
	at TestJcmdWithSideCar.testCase01(TestJcmdWithSideCar.java:138)
	at TestJcmdWithSideCar.main(TestJcmdWithSideCar.java:111)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:573)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1576)

...

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
>>                                                       1     0     1     0 <<
==============================


Whereas with `docker` (that runs containers as `root` by default) the test passes:


make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker"

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
                                                         1     1     0     0   
==============================


With `podman` and the changes in this PR, the test works again.

> While at it, I've discovered that the EventGeneratorLoop running container always runs for a fixed time: 30 seconds. That's irrespective of the attacher containers being done. Therefore, two iterations of the loop spawning this container running the fixed set of time will at least run 60 seconds.

Thanks for trying to improve this too, it was quite annoying to have to wait so long for each test run.. 😄 

However, when I'm running the test with `docker` with the changes from this PR (`make test TEST="jtreg:test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java" JTREG="JAVA_OPTIONS=-Djdk.test.container.command=docker"`) I get a new failure: [docker-failure.log](https://github.com/user-attachments/files/17227971/docker-failure.log). If I revert the test runtime optimization (and keep the disabling part) the test works with `docker` again.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21289#issuecomment-2388301598


More information about the serviceability-dev mailing list