mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-26 07:40:09 +00:00
Merge
This commit is contained in:
commit
36e2265a17
@ -141,9 +141,6 @@ java/lang/instrument/BootClassPath/BootClassPathTest.sh macosx-all
|
||||
# 8058492
|
||||
java/lang/management/ThreadMXBean/FindDeadlocks.java generic-all
|
||||
|
||||
# 8069286
|
||||
java/lang/management/MemoryMXBean/LowMemoryTest.java generic-all
|
||||
|
||||
############################################################################
|
||||
|
||||
# jdk_jmx
|
||||
|
||||
@ -32,8 +32,7 @@
|
||||
*
|
||||
* @library /lib/testlibrary/
|
||||
* @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
|
||||
* @requires vm.opt.ExplicitGCInvokesConcurrent == "false" | vm.opt.ExplicitGCInvokesConcurrent == "null"
|
||||
* @run main/timeout=600 LowMemoryTest
|
||||
* @run main/timeout=600 LowMemoryTest
|
||||
* @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
|
||||
* @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
|
||||
* @requires vm.opt.DisableExplicitGC != "true"
|
||||
@ -116,14 +115,13 @@ public class LowMemoryTest {
|
||||
triggers++;
|
||||
}
|
||||
public void checkResult() throws Exception {
|
||||
if ((!isRelaxed && triggers != NUM_TRIGGERS) ||
|
||||
(isRelaxed && triggers < NUM_TRIGGERS)) {
|
||||
if (!checkValue(triggers, NUM_TRIGGERS)) {
|
||||
throw new RuntimeException("Unexpected number of triggers = " +
|
||||
triggers + " but expected to be " + NUM_TRIGGERS);
|
||||
}
|
||||
|
||||
for (int i = 0; i < triggers; i++) {
|
||||
if (count[i] != i+1) {
|
||||
if (!checkValue(count[i], i + 1)) {
|
||||
throw new RuntimeException("Unexpected count of" +
|
||||
" notification #" + i +
|
||||
" count = " + count[i] +
|
||||
@ -136,6 +134,18 @@ public class LowMemoryTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkValue(int value, int target) {
|
||||
return checkValue((long)value, target);
|
||||
}
|
||||
|
||||
private boolean checkValue(long value, int target) {
|
||||
if (!isRelaxed) {
|
||||
return value == target;
|
||||
} else {
|
||||
return value >= target;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static long newThreshold;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user