PS Shortly after I pushed this fix I thought, "it would have been better to add the intermittent keyword to the test too." Please review this change to add the keyword:

diff -r a199b72a5b37 test/java/util/regex/RegExTest.java
--- a/test/java/util/regex/RegExTest.java    Wed May 06 21:15:07 2015 +0400
+++ b/test/java/util/regex/RegExTest.java    Wed May 06 15:18:59 2015 -0700
@@ -36,7 +36,7 @@
  * @library /lib/testlibrary
  * @build jdk.testlibrary.*
  * @run main RegExTest
- * @key randomness
+ * @key intermittent randomness
  */

 import java.util.function.Function;

Thanks,

-Joe

On 5/5/2015 3:25 PM, Xueming Shen wrote:
looks fine.

On 5/5/15 2:53 PM, Joseph D. Darcy wrote:
Hello,

The regression test

    test/java/util/regex/RegExTest.java

has been observed to intermittently fail. As the test uses randomness, I'd like to update to the test to use the random number testing library to better identify the cause of any future failures.

Please review the patch below:

diff -r 207c1b0356ea test/java/util/regex/RegExTest.java
--- a/test/java/util/regex/RegExTest.java Tue May 05 17:55:16 2015 +0100 +++ b/test/java/util/regex/RegExTest.java Tue May 05 14:50:10 2015 -0700
@@ -23,7 +23,7 @@

 /**
  * @test
- * @summary tests RegExp framework
+ * @summary tests RegExp framework (use -Dseed=X to set PRNG seed)
  * @author Mike McCloskey
  * @bug 4481568 4482696 4495089 4504687 4527731 4599621 4631553 4619345
* 4630911 4672616 4711773 4727935 4750573 4792284 4803197 4757029 4808962
@@ -33,6 +33,9 @@
* 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066 * 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590
  * 8027645 8035076 8039124 8035975 8074678
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
+ * @run main RegExTest
  * @key randomness
  */

@@ -50,7 +53,7 @@
  */
 public class RegExTest {

-    private static Random generator = new Random();
+    private static Random generator = RandomFactory.getRandom();
     private static boolean failure = false;
     private static int failCount = 0;
     private static String firstFailure = null;

Thanks,

-Joe


Reply via email to