ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ThreadPoolExecutorSubclassTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ThreadPoolExecutorSubclassTest.java (file contents):
Revision 1.35 by jsr166, Sat Apr 25 04:55:31 2015 UTC vs.
Revision 1.43 by jsr166, Mon Sep 28 08:23:49 2015 UTC

# Line 7 | Line 7
7   */
8  
9   import static java.util.concurrent.TimeUnit.MILLISECONDS;
10 + import static java.util.concurrent.TimeUnit.SECONDS;
11  
12   import java.util.ArrayList;
13   import java.util.List;
14   import java.util.concurrent.ArrayBlockingQueue;
15   import java.util.concurrent.BlockingQueue;
16   import java.util.concurrent.Callable;
17 + import java.util.concurrent.CancellationException;
18   import java.util.concurrent.CountDownLatch;
19   import java.util.concurrent.ExecutionException;
20   import java.util.concurrent.Executors;
# Line 28 | Line 30 | import java.util.concurrent.ThreadFactor
30   import java.util.concurrent.ThreadPoolExecutor;
31   import java.util.concurrent.TimeoutException;
32   import java.util.concurrent.TimeUnit;
33 + import java.util.concurrent.atomic.AtomicInteger;
34   import java.util.concurrent.locks.Condition;
35   import java.util.concurrent.locks.ReentrantLock;
36  
# Line 344 | Line 347 | public class ThreadPoolExecutorSubclassT
347       */
348      public void testGetKeepAliveTime() {
349          ThreadPoolExecutor p = new CustomTPE(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
350 <        assertEquals(1, p.getKeepAliveTime(TimeUnit.SECONDS));
350 >        assertEquals(1, p.getKeepAliveTime(SECONDS));
351          joinPool(p);
352      }
353  
# Line 697 | Line 700 | public class ThreadPoolExecutorSubclassT
700      }
701  
702      /**
703 <     * shutdownNow returns a list containing tasks that were not run
703 >     * shutdownNow returns a list containing tasks that were not run,
704 >     * and those tasks are drained from the queue
705       */
706 <    public void testShutdownNow() {
707 <        ThreadPoolExecutor p = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
708 <        List l;
709 <        try {
710 <            for (int i = 0; i < 5; i++)
711 <                p.execute(new MediumPossiblyInterruptedRunnable());
712 <        }
713 <        finally {
706 >    public void testShutdownNow() throws InterruptedException {
707 >        final int poolSize = 2;
708 >        final int count = 5;
709 >        final AtomicInteger ran = new AtomicInteger(0);
710 >        ThreadPoolExecutor p =
711 >            new CustomTPE(poolSize, poolSize, LONG_DELAY_MS, MILLISECONDS,
712 >                          new ArrayBlockingQueue<Runnable>(10));
713 >        CountDownLatch threadsStarted = new CountDownLatch(poolSize);
714 >        Runnable waiter = new CheckedRunnable() { public void realRun() {
715 >            threadsStarted.countDown();
716              try {
717 <                l = p.shutdownNow();
718 <            } catch (SecurityException ok) { return; }
717 >                MILLISECONDS.sleep(2 * LONG_DELAY_MS);
718 >            } catch (InterruptedException success) {}
719 >            ran.getAndIncrement();
720 >        }};
721 >        for (int i = 0; i < count; i++)
722 >            p.execute(waiter);
723 >        assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS));
724 >        assertEquals(poolSize, p.getActiveCount());
725 >        assertEquals(0, p.getCompletedTaskCount());
726 >        final List<Runnable> queuedTasks;
727 >        try {
728 >            queuedTasks = p.shutdownNow();
729 >        } catch (SecurityException ok) {
730 >            return; // Allowed in case test doesn't have privs
731          }
732          assertTrue(p.isShutdown());
733 <        assertTrue(l.size() <= 4);
733 >        assertTrue(p.getQueue().isEmpty());
734 >        assertEquals(count - poolSize, queuedTasks.size());
735 >        assertTrue(p.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
736 >        assertTrue(p.isTerminated());
737 >        assertEquals(poolSize, ran.get());
738 >        assertEquals(poolSize, p.getCompletedTaskCount());
739      }
740  
741      // Exception Tests
# Line 722 | Line 745 | public class ThreadPoolExecutorSubclassT
745       */
746      public void testConstructor1() {
747          try {
748 <            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
748 >            new CustomTPE(-1, 1, 1L, SECONDS,
749 >                          new ArrayBlockingQueue<Runnable>(10));
750              shouldThrow();
751          } catch (IllegalArgumentException success) {}
752      }
# Line 732 | Line 756 | public class ThreadPoolExecutorSubclassT
756       */
757      public void testConstructor2() {
758          try {
759 <            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
759 >            new CustomTPE(1, -1, 1L, SECONDS,
760 >                          new ArrayBlockingQueue<Runnable>(10));
761              shouldThrow();
762          } catch (IllegalArgumentException success) {}
763      }
# Line 742 | Line 767 | public class ThreadPoolExecutorSubclassT
767       */
768      public void testConstructor3() {
769          try {
770 <            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
770 >            new CustomTPE(1, 0, 1L, SECONDS,
771 >                          new ArrayBlockingQueue<Runnable>(10));
772              shouldThrow();
773          } catch (IllegalArgumentException success) {}
774      }
# Line 752 | Line 778 | public class ThreadPoolExecutorSubclassT
778       */
779      public void testConstructor4() {
780          try {
781 <            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
781 >            new CustomTPE(1, 2, -1L, SECONDS,
782 >                          new ArrayBlockingQueue<Runnable>(10));
783              shouldThrow();
784          } catch (IllegalArgumentException success) {}
785      }
# Line 762 | Line 789 | public class ThreadPoolExecutorSubclassT
789       */
790      public void testConstructor5() {
791          try {
792 <            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
792 >            new CustomTPE(2, 1, 1L, SECONDS,
793 >                          new ArrayBlockingQueue<Runnable>(10));
794              shouldThrow();
795          } catch (IllegalArgumentException success) {}
796      }
# Line 772 | Line 800 | public class ThreadPoolExecutorSubclassT
800       */
801      public void testConstructorNullPointerException() {
802          try {
803 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null);
803 >            new CustomTPE(1, 2, 1L, SECONDS, null);
804              shouldThrow();
805          } catch (NullPointerException success) {}
806      }
# Line 782 | Line 810 | public class ThreadPoolExecutorSubclassT
810       */
811      public void testConstructor6() {
812          try {
813 <            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
813 >            new CustomTPE(-1, 1, 1L, SECONDS,
814 >                          new ArrayBlockingQueue<Runnable>(10),
815 >                          new SimpleThreadFactory());
816              shouldThrow();
817          } catch (IllegalArgumentException success) {}
818      }
# Line 792 | Line 822 | public class ThreadPoolExecutorSubclassT
822       */
823      public void testConstructor7() {
824          try {
825 <            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
825 >            new CustomTPE(1,-1, 1L, SECONDS,
826 >                          new ArrayBlockingQueue<Runnable>(10),
827 >                          new SimpleThreadFactory());
828              shouldThrow();
829          } catch (IllegalArgumentException success) {}
830      }
# Line 802 | Line 834 | public class ThreadPoolExecutorSubclassT
834       */
835      public void testConstructor8() {
836          try {
837 <            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
837 >            new CustomTPE(1, 0, 1L, SECONDS,
838 >                          new ArrayBlockingQueue<Runnable>(10),
839 >                          new SimpleThreadFactory());
840              shouldThrow();
841          } catch (IllegalArgumentException success) {}
842      }
# Line 812 | Line 846 | public class ThreadPoolExecutorSubclassT
846       */
847      public void testConstructor9() {
848          try {
849 <            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
849 >            new CustomTPE(1, 2, -1L, SECONDS,
850 >                          new ArrayBlockingQueue<Runnable>(10),
851 >                          new SimpleThreadFactory());
852              shouldThrow();
853          } catch (IllegalArgumentException success) {}
854      }
# Line 822 | Line 858 | public class ThreadPoolExecutorSubclassT
858       */
859      public void testConstructor10() {
860          try {
861 <            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
861 >            new CustomTPE(2, 1, 1L, SECONDS,
862 >                          new ArrayBlockingQueue<Runnable>(10),
863 >                          new SimpleThreadFactory());
864              shouldThrow();
865          } catch (IllegalArgumentException success) {}
866      }
# Line 832 | Line 870 | public class ThreadPoolExecutorSubclassT
870       */
871      public void testConstructorNullPointerException2() {
872          try {
873 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory());
873 >            new CustomTPE(1, 2, 1L, SECONDS, null, new SimpleThreadFactory());
874              shouldThrow();
875          } catch (NullPointerException success) {}
876      }
# Line 842 | Line 880 | public class ThreadPoolExecutorSubclassT
880       */
881      public void testConstructorNullPointerException3() {
882          try {
883 <            ThreadFactory f = null;
884 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f);
883 >            new CustomTPE(1, 2, 1L, SECONDS,
884 >                          new ArrayBlockingQueue<Runnable>(10),
885 >                          (ThreadFactory) null);
886              shouldThrow();
887          } catch (NullPointerException success) {}
888      }
# Line 853 | Line 892 | public class ThreadPoolExecutorSubclassT
892       */
893      public void testConstructor11() {
894          try {
895 <            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
895 >            new CustomTPE(-1, 1, 1L, SECONDS,
896 >                          new ArrayBlockingQueue<Runnable>(10),
897 >                          new NoOpREHandler());
898              shouldThrow();
899          } catch (IllegalArgumentException success) {}
900      }
# Line 863 | Line 904 | public class ThreadPoolExecutorSubclassT
904       */
905      public void testConstructor12() {
906          try {
907 <            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
907 >            new CustomTPE(1, -1, 1L, SECONDS,
908 >                          new ArrayBlockingQueue<Runnable>(10),
909 >                          new NoOpREHandler());
910              shouldThrow();
911          } catch (IllegalArgumentException success) {}
912      }
# Line 873 | Line 916 | public class ThreadPoolExecutorSubclassT
916       */
917      public void testConstructor13() {
918          try {
919 <            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
919 >            new CustomTPE(1, 0, 1L, SECONDS,
920 >                          new ArrayBlockingQueue<Runnable>(10),
921 >                          new NoOpREHandler());
922              shouldThrow();
923          } catch (IllegalArgumentException success) {}
924      }
# Line 883 | Line 928 | public class ThreadPoolExecutorSubclassT
928       */
929      public void testConstructor14() {
930          try {
931 <            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
931 >            new CustomTPE(1, 2, -1L, SECONDS,
932 >                          new ArrayBlockingQueue<Runnable>(10),
933 >                          new NoOpREHandler());
934              shouldThrow();
935          } catch (IllegalArgumentException success) {}
936      }
# Line 893 | Line 940 | public class ThreadPoolExecutorSubclassT
940       */
941      public void testConstructor15() {
942          try {
943 <            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
943 >            new CustomTPE(2, 1, 1L, SECONDS,
944 >                          new ArrayBlockingQueue<Runnable>(10),
945 >                          new NoOpREHandler());
946              shouldThrow();
947          } catch (IllegalArgumentException success) {}
948      }
# Line 903 | Line 952 | public class ThreadPoolExecutorSubclassT
952       */
953      public void testConstructorNullPointerException4() {
954          try {
955 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null,new NoOpREHandler());
955 >            new CustomTPE(1, 2, 1L, SECONDS,
956 >                          null,
957 >                          new NoOpREHandler());
958              shouldThrow();
959          } catch (NullPointerException success) {}
960      }
# Line 913 | Line 964 | public class ThreadPoolExecutorSubclassT
964       */
965      public void testConstructorNullPointerException5() {
966          try {
967 <            RejectedExecutionHandler r = null;
968 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),r);
967 >            new CustomTPE(1, 2, 1L, SECONDS,
968 >                          new ArrayBlockingQueue<Runnable>(10),
969 >                          (RejectedExecutionHandler) null);
970              shouldThrow();
971          } catch (NullPointerException success) {}
972      }
# Line 924 | Line 976 | public class ThreadPoolExecutorSubclassT
976       */
977      public void testConstructor16() {
978          try {
979 <            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
979 >            new CustomTPE(-1, 1, 1L, SECONDS,
980 >                          new ArrayBlockingQueue<Runnable>(10),
981 >                          new SimpleThreadFactory(),
982 >                          new NoOpREHandler());
983              shouldThrow();
984          } catch (IllegalArgumentException success) {}
985      }
# Line 934 | Line 989 | public class ThreadPoolExecutorSubclassT
989       */
990      public void testConstructor17() {
991          try {
992 <            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
992 >            new CustomTPE(1, -1, 1L, SECONDS,
993 >                          new ArrayBlockingQueue<Runnable>(10),
994 >                          new SimpleThreadFactory(),
995 >                          new NoOpREHandler());
996              shouldThrow();
997          } catch (IllegalArgumentException success) {}
998      }
# Line 944 | Line 1002 | public class ThreadPoolExecutorSubclassT
1002       */
1003      public void testConstructor18() {
1004          try {
1005 <            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
1005 >            new CustomTPE(1, 0, 1L, SECONDS,
1006 >                          new ArrayBlockingQueue<Runnable>(10),
1007 >                          new SimpleThreadFactory(),
1008 >                          new NoOpREHandler());
1009              shouldThrow();
1010          } catch (IllegalArgumentException success) {}
1011      }
# Line 954 | Line 1015 | public class ThreadPoolExecutorSubclassT
1015       */
1016      public void testConstructor19() {
1017          try {
1018 <            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
1018 >            new CustomTPE(1, 2, -1L, SECONDS,
1019 >                          new ArrayBlockingQueue<Runnable>(10),
1020 >                          new SimpleThreadFactory(),
1021 >                          new NoOpREHandler());
1022              shouldThrow();
1023          } catch (IllegalArgumentException success) {}
1024      }
# Line 964 | Line 1028 | public class ThreadPoolExecutorSubclassT
1028       */
1029      public void testConstructor20() {
1030          try {
1031 <            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
1031 >            new CustomTPE(2, 1, 1L, SECONDS,
1032 >                          new ArrayBlockingQueue<Runnable>(10),
1033 >                          new SimpleThreadFactory(),
1034 >                          new NoOpREHandler());
1035              shouldThrow();
1036          } catch (IllegalArgumentException success) {}
1037      }
# Line 974 | Line 1041 | public class ThreadPoolExecutorSubclassT
1041       */
1042      public void testConstructorNullPointerException6() {
1043          try {
1044 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory(),new NoOpREHandler());
1044 >            new CustomTPE(1, 2, 1L, SECONDS,
1045 >                          null,
1046 >                          new SimpleThreadFactory(),
1047 >                          new NoOpREHandler());
1048              shouldThrow();
1049          } catch (NullPointerException success) {}
1050      }
# Line 984 | Line 1054 | public class ThreadPoolExecutorSubclassT
1054       */
1055      public void testConstructorNullPointerException7() {
1056          try {
1057 <            RejectedExecutionHandler r = null;
1058 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),r);
1057 >            new CustomTPE(1, 2, 1L, SECONDS,
1058 >                          new ArrayBlockingQueue<Runnable>(10),
1059 >                          new SimpleThreadFactory(),
1060 >                          (RejectedExecutionHandler) null);
1061              shouldThrow();
1062          } catch (NullPointerException success) {}
1063      }
# Line 995 | Line 1067 | public class ThreadPoolExecutorSubclassT
1067       */
1068      public void testConstructorNullPointerException8() {
1069          try {
1070 <            new CustomTPE(1, 2,
999 <                          LONG_DELAY_MS, MILLISECONDS,
1070 >            new CustomTPE(1, 2, 1L, SECONDS,
1071                            new ArrayBlockingQueue<Runnable>(10),
1072                            (ThreadFactory) null,
1073                            new NoOpREHandler());
# Line 1174 | Line 1245 | public class ThreadPoolExecutorSubclassT
1245       * execute(null) throws NPE
1246       */
1247      public void testExecuteNull() {
1248 <        ThreadPoolExecutor p = null;
1248 >        ThreadPoolExecutor p =
1249 >            new CustomTPE(1, 2, 1L, SECONDS,
1250 >                          new ArrayBlockingQueue<Runnable>(10));
1251          try {
1179            p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
1252              p.execute(null);
1253              shouldThrow();
1254          } catch (NullPointerException success) {}
# Line 1687 | Line 1759 | public class ThreadPoolExecutorSubclassT
1759      public void testTimedInvokeAll6() throws Exception {
1760          ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
1761          try {
1762 <            List<Callable<String>> l = new ArrayList<Callable<String>>();
1763 <            l.add(new StringTask());
1764 <            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
1765 <            l.add(new StringTask());
1766 <            List<Future<String>> futures =
1767 <                e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS);
1768 <            assertEquals(l.size(), futures.size());
1769 <            for (Future future : futures)
1770 <                assertTrue(future.isDone());
1771 <            assertFalse(futures.get(0).isCancelled());
1772 <            assertTrue(futures.get(1).isCancelled());
1762 >            for (long timeout = timeoutMillis();;) {
1763 >                List<Callable<String>> tasks = new ArrayList<>();
1764 >                tasks.add(new StringTask("0"));
1765 >                tasks.add(Executors.callable(new LongPossiblyInterruptedRunnable(), TEST_STRING));
1766 >                tasks.add(new StringTask("2"));
1767 >                long startTime = System.nanoTime();
1768 >                List<Future<String>> futures =
1769 >                    e.invokeAll(tasks, timeout, MILLISECONDS);
1770 >                assertEquals(tasks.size(), futures.size());
1771 >                assertTrue(millisElapsedSince(startTime) >= timeout);
1772 >                for (Future future : futures)
1773 >                    assertTrue(future.isDone());
1774 >                assertTrue(futures.get(1).isCancelled());
1775 >                try {
1776 >                    assertEquals("0", futures.get(0).get());
1777 >                    assertEquals("2", futures.get(2).get());
1778 >                    break;
1779 >                } catch (CancellationException retryWithLongerTimeout) {
1780 >                    timeout *= 2;
1781 >                    if (timeout >= LONG_DELAY_MS / 2)
1782 >                        fail("expected exactly one task to be cancelled");
1783 >                }
1784 >            }
1785          } finally {
1786              joinPool(e);
1787          }
# Line 1740 | Line 1824 | public class ThreadPoolExecutorSubclassT
1824       * allowCoreThreadTimeOut(true) causes idle threads to time out
1825       */
1826      public void testAllowCoreThreadTimeOut_true() throws Exception {
1827 <        long coreThreadTimeOut = SHORT_DELAY_MS;
1827 >        long keepAliveTime = timeoutMillis();
1828          final ThreadPoolExecutor p =
1829              new CustomTPE(2, 10,
1830 <                          coreThreadTimeOut, MILLISECONDS,
1830 >                          keepAliveTime, MILLISECONDS,
1831                            new ArrayBlockingQueue<Runnable>(10));
1832          final CountDownLatch threadStarted = new CountDownLatch(1);
1833          try {
1834              p.allowCoreThreadTimeOut(true);
1835              p.execute(new CheckedRunnable() {
1836 <                public void realRun() throws InterruptedException {
1836 >                public void realRun() {
1837                      threadStarted.countDown();
1838                      assertEquals(1, p.getPoolSize());
1839                  }});
1840              await(threadStarted);
1841 <            delay(coreThreadTimeOut);
1841 >            delay(keepAliveTime);
1842              long startTime = System.nanoTime();
1843              while (p.getPoolSize() > 0
1844                     && millisElapsedSince(startTime) < LONG_DELAY_MS)
# Line 1770 | Line 1854 | public class ThreadPoolExecutorSubclassT
1854       * allowCoreThreadTimeOut(false) causes idle threads not to time out
1855       */
1856      public void testAllowCoreThreadTimeOut_false() throws Exception {
1857 <        long coreThreadTimeOut = SHORT_DELAY_MS;
1857 >        long keepAliveTime = timeoutMillis();
1858          final ThreadPoolExecutor p =
1859              new CustomTPE(2, 10,
1860 <                          coreThreadTimeOut, MILLISECONDS,
1860 >                          keepAliveTime, MILLISECONDS,
1861                            new ArrayBlockingQueue<Runnable>(10));
1862          final CountDownLatch threadStarted = new CountDownLatch(1);
1863          try {
# Line 1783 | Line 1867 | public class ThreadPoolExecutorSubclassT
1867                      threadStarted.countDown();
1868                      assertTrue(p.getPoolSize() >= 1);
1869                  }});
1870 <            delay(2 * coreThreadTimeOut);
1870 >            delay(2 * keepAliveTime);
1871              assertTrue(p.getPoolSize() >= 1);
1872          } finally {
1873              joinPool(p);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines