-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PROC_ROOT (after JDK-8327114) #21289
Conversation
Before: Passed: containers/docker/TestJcmdWithSideCar.java build: 2.08 seconds compile: 2.068 seconds build: 4.842 seconds compile: 4.841 seconds driver: 70.776 seconds Test results: passed: 1 After: Passed: containers/docker/TestJcmdWithSideCar.java build: 2.169 seconds compile: 2.157 seconds build: 4.964 seconds compile: 4.963 seconds driver: 22.928 seconds Test results: passed: 1
👋 Welcome back sgehwolf! A progress list of the required criteria for merging this PR into |
@jerboaa This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 39 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/label add serviceability |
@jerboaa |
PTAL @slovdahl Thanks! |
Webrevs
|
Thanks for clarifying the different testing combinations and the pointer to the missing one for follow up in JDK-8341349. |
Thanks, Kevin. |
@jerboaa Thanks a lot for the thorough investigation here! I was also able to reproduce the failure locally on my Ubuntu 24.04 using
Whereas with
With
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 |
Thanks. Fails with:
We'll have to do |
Updated in ef7abf2 If that doesn't work, I'll remove the test run time optimization. |
Right, this turned into a rabbit hole of its own.. 😁
I think the underlying problem is that killing the process from the Java test is not properly propagated to the diff --git test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
index 5132f14d788..4726284cff1 100644
--- test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
+++ test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
@@ -251,8 +251,9 @@ public Process start(final boolean elevated) throws Exception {
OutputAnalyzer out = DockerTestUtils.execute(Container.ENGINE_COMMAND, "ps")
.shouldHaveExitValue(0);
if (out.contains(MAIN_CONTAINER_NAME)) {
- DockerTestUtils.execute(Container.ENGINE_COMMAND, "rm", MAIN_CONTAINER_NAME)
+ DockerTestUtils.execute(Container.ENGINE_COMMAND, "stop", "--time=1", "--signal=SIGKILL", MAIN_CONTAINER_NAME)
.shouldHaveExitValue(0);
}
// start "main" container (the observee)
DockerRunOptions opts = commonDockerOpts("EventGeneratorLoop"); ..only to be met by:
Because we start containers with diff --git test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
index 5132f14d788..4726284cff1 100644
--- test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
+++ test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
@@ -251,8 +251,9 @@ public Process start(final boolean elevated) throws Exception {
OutputAnalyzer out = DockerTestUtils.execute(Container.ENGINE_COMMAND, "ps")
.shouldHaveExitValue(0);
if (out.contains(MAIN_CONTAINER_NAME)) {
- DockerTestUtils.execute(Container.ENGINE_COMMAND, "rm", MAIN_CONTAINER_NAME)
+ DockerTestUtils.execute(Container.ENGINE_COMMAND, "stop", "--time=1", "--signal=SIGKILL", MAIN_CONTAINER_NAME)
.shouldHaveExitValue(0);
+ Thread.sleep(1_000L);
}
// start "main" container (the observee)
DockerRunOptions opts = commonDockerOpts("EventGeneratorLoop"); |
Thanks. I'll remove this part from the patch as it's orthogonal to the actual issue and would just like to get the test passing again. |
Filed https://bugs.openjdk.org/browse/JDK-8341436 to track this separate issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Do you intend to look into this yourself? If not, I would be happy to pick it up. |
I spent some time thinking about this, and I'm not sure if it can be solved? The test case that fails with Podman is |
It finally occurred to me why |
Please go ahead and have a go at this. |
@kevinjwalls Any update on this? Thanks! |
Good timing, I was just writing: Thanks, looks good. Good to delay the additional changes. With the test as it stands in the repo currently, I am seeing another failure. I don't get this myself with the change in this PR, but that may just be luck. It's on Linux x64, with TMP_MOUNTED_INTO_SIDECAR, where the command: docker run --tty=true --rm --cap-add=SYS_PTRACE --sig-proxy=true --pid=container:test-container-main --cap-add=NET_BIND_SERVICE --user=10668:10668 --volumes-from test-container-main jdk-internal:test-containers-docker-TestJcmdWithSideCar-jfr-jcmd /jdk/bin/jcmd -l ...gets no output, where a good run would show: [STDOUT] e.g. [main-container-process] MAIN_METHOD_STARTED, argument is 120 [STDOUT] Full child process STDOUT was saved to docker-stdout-12125.log [STDOUT] Full child process STDOUT was saved to docker-stdout-12260.log java.lang.RuntimeException: 'sun.tools.jcmd.JCmd' missing from stdout/stderr |
OK. Done.
I'm confused. Are you saying that after this patch in revision 24a4303 there are still failures in Oracle's CI? |
Sorry, was saying that the other failure type, ("'sun.tools.jcmd.JCmd' missing") is happening now in CI. I have not reproduced it with the change in this PR. But, as that "other" failure is happening with "sidecar", skipping ACCESS_TMP_VIA_PROC_ROOT should not fix it? So maybe there is e.g. a chance/timing problem. Either way, this change as it stands is still good, I think we should get it in to minimise the problems. I can monitor and see if the "JCmd missing" problem happens again. |
Thanks! /integrate |
Going to push as commit 21f8ccf.
Your commit was automatically rebased without conflicts. |
This change is working, having the intended effect. 8-) |
The change of JDK-8327114 also increased test coverage. In particular, the
TestJcmdWithSideCar.java
test got enhanced to cover these cases (prior to JDK-8327114 only case 1 was tested):The OpenJDK attach code is able to handle cases 1 through 3 which pass, but the last case,
4
, hasn't been implemented yet when running as regular user and directing the container runtime to map the container user to that user as well. Thus, the test fails. For now I propose to disable the 4th test case. It can get re-enabled once the product code got updated to account for this case (tracked in https://bugs.openjdk.org/browse/JDK-8341349).Thoughts? Could somebody please run this through Oracle's test system in order to see if this fixes the issue? Thank you!
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21289/head:pull/21289
$ git checkout pull/21289
Update a local copy of the PR:
$ git checkout pull/21289
$ git pull https://git.openjdk.org/jdk.git pull/21289/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21289
View PR using the GUI difftool:
$ git pr show -t 21289
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21289.diff
Webrev
Link to Webrev Comment