Skip to content

Conversation

jmtd
Copy link
Member

@jmtd jmtd commented Feb 17, 2025

The hsperfdata path is determined by the running user's username. This is no longer "jboss", but "default". Use "${USER}" so that we catch any future changes in username.


https://issues.redhat.com/browse/OPENJDK-3637


This is quite hard to write a Behave test for. We need to perform an S2I build that invokes maven, which in turn invokes java, to create a hsperfdata directory. Then, we need to start a new container instance from the output of S2I, but override CMD so that the payload (java) doesn't start (which would create it's own hsperfdata), in order to test for its presence or absence. There aren't the right steps in https://github.com/cekit/behave-test-steps to pull this off. I started writingt some but they'll take some work to get right.

The hsperfdata path is determined by the running user's username.
This is no longer "jboss", but "default". Use "${USER}" so that we
catch any future changes in username.

Signed-off-by: Jonathan Dowland <[email protected]>
@jmtd jmtd requested a review from jerboaa February 17, 2025 14:29
@jmtd
Copy link
Member Author

jmtd commented Feb 17, 2025

Manual testing:

BASEIMG=ubi9/openjdk-21:1.18  # substitute appropriately
APPSRC=https://github.com/rh-openjdk/openjdk-container-test-applications.git
CONTEXTDIR=spring-boot-sample-simple
rev=master
OUTIMG=s2i-out


s2i build --pull-policy never --context-dir=$CONTEXTDIR -r=${rev} \
    $APPSRC \
    $BASEIMG \
    $OUTIMG

docker run --rm -ti $OUTIMG stat /tmp/hsperfdata_default

bad output:

…
  File: /tmp/hsperfdata_default
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 4fh/79d	Inode: 663433      Links: 2
Access: (0755/drwxr-xr-x)  Uid: (  185/ default)   Gid: (    0/    root)
Access: 2025-02-17 14:30:28.691995151 +0000
Modify: 2025-02-17 14:30:27.000000000 +0000
Change: 2025-02-17 14:30:28.671994155 +0000
 Birth: 2025-02-17 14:30:28.667993957 +0000

Good output:

…
No such file or directory

@jmtd jmtd requested review from jerboaa and removed request for jerboaa February 17, 2025 14:33
@jmtd jmtd merged commit 7b635be into rh-openjdk:ubi9 Feb 17, 2025
6 checks passed
@jmtd jmtd deleted the 3637-hsperfdata branch February 24, 2025 16:30
@jmtd jmtd added the ubi9 RHEL UBI 9 label Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ubi9 RHEL UBI 9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants