RFR: 8303470: containers/docker/TestMemoryAwareness.java failed with "'memory_limit_in_bytes:.*512000 k' missing from stdout/stderr"
Casper Norrbin
cnorrbin at openjdk.org
Tue Jan 20 13:22:01 UTC 2026
Hi everyone,
When printing VM container info with trace container logging enabled, it is possible for the output to become interleaved. This can cause `TestMemoryAwareness.java` to fail, since the string it expects may be split by trace output appearing in the middle of the VM.info line.
In #28766, I added improved VM.info formatting with the `OSContainer::print_container_metric` function, but it still performed printing in 2 steps, making it possible for that output to be split. With this PR, I have changed this so we construct the full line with `snprintf` before printing, ensuring the whole line is printed in a single step. This prevents other output from splitting the line, so the test can reliably detect the expected values.
Since the test now works as expected, I have also removed it from the problemlist.
Testing:
- Oracle tiers 1-5
- Local container tests on cgroup v1/v2 with both podman and docker
- Repeated runs of `TestMemoryAwareness.java` without any observed failures
-------------
Commit messages:
- one-print-metrics
Changes: https://git.openjdk.org/jdk/pull/29319/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29319&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8303470
Stats: 8 lines in 2 files changed: 1 ins; 1 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/29319.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29319/head:pull/29319
PR: https://git.openjdk.org/jdk/pull/29319
More information about the hotspot-runtime-dev
mailing list