提交 ef5fd7ab 编写于 作者: S sjiang

8025207: Intermittent test failure: javax/management/monitor/CounterMonitorThresholdTest.java

Reviewed-by: dfuchs, dholmes
上级 6cf13553
......@@ -23,7 +23,7 @@
/*
* @test
* @bug 6229368
* @bug 6229368 8025207
* @summary Wrong threshold value in CounterMonitor with offset and modulus.
* @author Luis-Miguel Alventosa
* @run clean CounterMonitorThresholdTest
......@@ -144,16 +144,14 @@ public class CounterMonitorThresholdTest {
for (int i = 0; i < counter.length; i++) {
mbean.setCounter(counter[i]);
System.out.println("\nCounter = " + mbean.getCounter());
Thread.sleep(300);
Integer derivedGaugeValue = (Integer) cm.getDerivedGauge(name);
System.out.println("Derived Gauge = " + derivedGaugeValue);
if (derivedGaugeValue.intValue() != derivedGauge[i]) {
System.out.println("Wrong derived gauge! Current value = " +
derivedGaugeValue + " Expected value = " + derivedGauge[i]);
System.out.println("\nStop monitoring...");
cm.stop();
throw new IllegalArgumentException("wrong derived gauge");
}
Integer derivedGaugeValue;
// either pass or test timeout (killed by test harness)
// see 8025207
do {
Thread.sleep(150);
derivedGaugeValue = (Integer) cm.getDerivedGauge(name);
} while (derivedGaugeValue.intValue() != derivedGauge[i]);
Number thresholdValue = cm.getThreshold(name);
System.out.println("Threshold = " + thresholdValue);
if (thresholdValue.intValue() != threshold[i]) {
......@@ -163,7 +161,6 @@ public class CounterMonitorThresholdTest {
cm.stop();
throw new IllegalArgumentException("wrong threshold");
}
Thread.sleep(300);
}
// Stop the monitor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册