RFR(S): 7198849: Make javax/management/remote/mandatory/notif/ListenerScaleTest.java less timing sensitive

Staffan Larsen staffan.larsen at oracle.com
Mon Sep 17 02:16:08 PDT 2012


The test sometimes fails with a ratio somewhere in the low 100s. If the timing was indeed linear in the number of listeners, the ratio would be 20000. Increasing the allowed ration to 500 (from 100) should therefore still catch the real regression, but make the test more robust.

Thanks,
/Staffan


diff --git a/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java b/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
--- a/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
+++ b/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
@@ -45,7 +45,7 @@
  *
  * As usual with timing-sensitive tests, we could potentially get
  * sporadic failures.  We fail if the ratio of the time with many
- * MBeans to the time with just one MBean is more than 100.  With the
+ * MBeans to the time with just one MBean is more than 500.  With the
  * fix in place, it is usually less than 1, presumably because some
  * code was being interpreted during the first measurement but had
  * been compiled by the second.
@@ -176,7 +176,7 @@
         long manyMBeansTime = timeNotif(mbs);
         System.out.println("Time with many MBeans: " + manyMBeansTime + "ns");
         double ratio = (double) manyMBeansTime / singleMBeanTime;
-        if (ratio > 100.0)
+        if (ratio > 500.0)
             throw new Exception("Failed: ratio=" + ratio);
         System.out.println("Test passed: ratio=" + ratio);
     }


More information about the serviceability-dev mailing list