RFR: 8303470: containers/docker/TestMemoryAwareness.java failed with "'memory_limit_in_bytes:.*512000 k' missing from stdout/stderr"
Severin Gehwolf
sgehwolf at openjdk.org
Tue Jan 20 17:40:09 UTC 2026
On Tue, 20 Jan 2026 13:14:22 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:
> 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
Looks good.
-------------
Marked as reviewed by sgehwolf (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29319#pullrequestreview-3683460500
More information about the hotspot-runtime-dev
mailing list