Skip to content

Commit

Permalink
8275713: TestDockerMemoryMetrics test fails on recent runc
Browse files Browse the repository at this point in the history
Reviewed-by: mbaesken
  • Loading branch information
jerboaa committed Oct 28, 2021
1 parent 43f27be commit fd22289
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import jdk.internal.platform.Metrics;

public class MetricsMemoryTester {

private static final long UNLIMITED = -1;

public static void main(String[] args) {
System.out.println(Arrays.toString(args));
switch (args[0]) {
Expand Down Expand Up @@ -109,7 +112,10 @@ private static void testMemorySoftLimit(String softLimit) {
private static void testKernelMemoryLimit(String value) {
long limit = getMemoryValue(value);
long kmemlimit = Metrics.systemMetrics().getKernelMemoryLimit();
if (kmemlimit != 0 && limit != kmemlimit) {
// Note that the kernel memory limit might get ignored by OCI runtimes
// This feature is deprecated. Only perform the check if we get an actual
// limit back.
if (kmemlimit != UNLIMITED && limit != kmemlimit) {
throw new RuntimeException("Kernel Memory limit not equal, expected : ["
+ limit + "]" + ", got : ["
+ kmemlimit + "]");
Expand Down

1 comment on commit fd22289

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.