8148928: java/util/stream/test/**/SequentialOpTest.java timed out intermittently
authoramlu
Fri, 05 Feb 2016 09:54:56 +0800
changeset 35710 0abd8971cc6e
parent 35709 5a839af07958
child 35711 d08f24178498
8148928: java/util/stream/test/**/SequentialOpTest.java timed out intermittently Reviewed-by: psandoz Contributed-by: huaming.li@oracle.com
jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java
jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java
--- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java	Thu Feb 04 16:49:26 2016 -0800
+++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java	Fri Feb 05 09:54:56 2016 +0800
@@ -47,6 +47,7 @@
 
     private static final Object[][] testData;
     private static final Object[][] testSmallData;
+    private static final Object[][] testMiniData;
     private static final Object[][] withNullTestData;
     private static final Object[][] spliteratorTestData;
 
@@ -85,6 +86,7 @@
 
     static {
         {
+            List<Object[]> listMini = new ArrayList<>();
             List<Object[]> listSmall = new ArrayList<>();
             List<Object[]> list1000 = new ArrayList<>();
             List<Object[]> list = null;
@@ -93,7 +95,7 @@
                 final Integer[] ints = (Integer[])data[1];
                 final List<Integer> intsAsList = Arrays.asList(ints);
 
-                list = ints.length >= 1000 ? list1000 : listSmall;
+                list = ints.length >= 1000 ? list1000 : (ints.length >= 100 ? listSmall : listMini);
 
                 list.add(arrayDataDescr("array:" + name, ints));
                 list.add(collectionDataDescr("ArrayList.asList:" + name, intsAsList));
@@ -119,6 +121,8 @@
 
                 // @@@ Add more
             }
+            testMiniData = listMini.toArray(new Object[0][]);
+            listSmall.addAll(listMini);
             testSmallData = listSmall.toArray(new Object[0][]);
             list1000.addAll(listSmall);
             testData = list1000.toArray(new Object[0][]);
@@ -204,6 +208,11 @@
         return testSmallData;
     }
 
+    @DataProvider(name = "StreamTestData<Integer>.mini")
+    public static Object[][] makeMiniStreamTestData() {
+        return testMiniData;
+    }
+
     @DataProvider(name = "withNull:StreamTestData<Integer>")
     public static Object[][] makeStreamWithNullTestData() {
         return withNullTestData;
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java	Thu Feb 04 16:49:26 2016 -0800
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java	Fri Feb 05 09:54:56 2016 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -94,7 +94,7 @@
     }
 
     @SuppressWarnings({"rawtypes", "unchecked"})
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    @Test(dataProvider = "StreamTestData<Integer>.mini", dataProviderClass = StreamTestDataProvider.class)
     public void testMixedSeqPar(String name, TestData.OfRef<Integer> data) {
         Function<Integer, Integer> id = LambdaTestHelpers.identity();
         UnaryOperator<Stream<Integer>>[] changers