8224502: [TESTBUG] JDK docker test TestSystemMetrics.java fails with access issues and OOM

Reviewed-by: sgehwolf, mseledtsov
This commit is contained in:
Bob Vandette 2019-06-24 11:49:59 -04:00
parent 6ad9eba4cd
commit 4786d88ba9
3 changed files with 3 additions and 3 deletions

View File

@ -878,4 +878,3 @@ jdk/jfr/event/io/EvilInstrument.java 8221331 gener
# jdk/internal/docker
jdk/internal/platform/docker/TestDockerMemoryMetrics.java 8224506 generic-all
jdk/internal/platform/docker/TestSystemMetrics.java 8224502 generic-all

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -51,6 +51,7 @@ public class TestSystemMetrics {
DockerRunOptions opts =
new DockerRunOptions(imageName, "/jdk/bin/java", "jdk.test.lib.containers.cgroup.MetricsTester");
opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/");
opts.addDockerOpts("--memory=256m");
opts.addJavaOpts("-cp", "/test-classes/");
opts.addJavaOpts("--add-exports", "java.base/jdk.internal.platform=ALL-UNNAMED");
DockerTestUtils.dockerRunJava(opts).shouldHaveExitValue(0).shouldContain("TEST PASSED!!!");

View File

@ -560,7 +560,7 @@ public class MetricsTester {
long memoryMaxUsage = metrics.getMemoryMaxUsage();
long memoryUsage = metrics.getMemoryUsage();
long[] ll = new long[64*1024*1024]; // 64M
byte[] bb = new byte[64*1024*1024]; // 64M
long newMemoryMaxUsage = metrics.getMemoryMaxUsage();
long newMemoryUsage = metrics.getMemoryUsage();