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

Comparing jsr166/src/test/tck/ThreadPoolExecutorTest.java (file contents):
Revision 1.102 by jsr166, Mon Oct 5 22:09:02 2015 UTC vs.
Revision 1.113 by jsr166, Wed Aug 24 22:22:39 2016 UTC

# Line 28 | Line 28 | import java.util.concurrent.RejectedExec
28   import java.util.concurrent.SynchronousQueue;
29   import java.util.concurrent.ThreadFactory;
30   import java.util.concurrent.ThreadPoolExecutor;
31 import java.util.concurrent.TimeUnit;
31   import java.util.concurrent.atomic.AtomicInteger;
32  
33   import junit.framework.Test;
# Line 101 | Line 100 | public class ThreadPoolExecutorTest exte
100       * thread becomes active
101       */
102      public void testGetActiveCount() throws InterruptedException {
103 +        final CountDownLatch done = new CountDownLatch(1);
104          final ThreadPoolExecutor p =
105              new ThreadPoolExecutor(2, 2,
106                                     LONG_DELAY_MS, MILLISECONDS,
107                                     new ArrayBlockingQueue<Runnable>(10));
108 <        try (PoolCleaner cleaner = cleaner(p)) {
108 >        try (PoolCleaner cleaner = cleaner(p, done)) {
109              final CountDownLatch threadStarted = new CountDownLatch(1);
110            final CountDownLatch done = new CountDownLatch(1);
110              assertEquals(0, p.getActiveCount());
111              p.execute(new CheckedRunnable() {
112                  public void realRun() throws InterruptedException {
113                      threadStarted.countDown();
114                      assertEquals(1, p.getActiveCount());
115 <                    done.await();
115 >                    await(done);
116                  }});
117 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
117 >            await(threadStarted);
118              assertEquals(1, p.getActiveCount());
120            done.countDown();
119          }
120      }
121  
# Line 329 | Line 327 | public class ThreadPoolExecutorTest exte
327       */
328      public void testGetLargestPoolSize() throws InterruptedException {
329          final int THREADS = 3;
330 +        final CountDownLatch done = new CountDownLatch(1);
331          final ThreadPoolExecutor p =
332              new ThreadPoolExecutor(THREADS, THREADS,
333                                     LONG_DELAY_MS, MILLISECONDS,
334                                     new ArrayBlockingQueue<Runnable>(10));
335 <        try (PoolCleaner cleaner = cleaner(p)) {
337 <            final CountDownLatch threadsStarted = new CountDownLatch(THREADS);
338 <            final CountDownLatch done = new CountDownLatch(1);
335 >        try (PoolCleaner cleaner = cleaner(p, done)) {
336              assertEquals(0, p.getLargestPoolSize());
337 +            final CountDownLatch threadsStarted = new CountDownLatch(THREADS);
338              for (int i = 0; i < THREADS; i++)
339                  p.execute(new CheckedRunnable() {
340                      public void realRun() throws InterruptedException {
341                          threadsStarted.countDown();
342 <                        done.await();
342 >                        await(done);
343                          assertEquals(THREADS, p.getLargestPoolSize());
344                      }});
345 <            assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS));
345 >            await(threadsStarted);
346              assertEquals(THREADS, p.getLargestPoolSize());
349            done.countDown();   // release pool
347          }
348          assertEquals(THREADS, p.getLargestPoolSize());
349      }
# Line 374 | Line 371 | public class ThreadPoolExecutorTest exte
371       * become active
372       */
373      public void testGetPoolSize() throws InterruptedException {
374 +        final CountDownLatch done = new CountDownLatch(1);
375          final ThreadPoolExecutor p =
376              new ThreadPoolExecutor(1, 1,
377                                     LONG_DELAY_MS, MILLISECONDS,
378                                     new ArrayBlockingQueue<Runnable>(10));
379 <        try (PoolCleaner cleaner = cleaner(p)) {
382 <            final CountDownLatch threadStarted = new CountDownLatch(1);
383 <            final CountDownLatch done = new CountDownLatch(1);
379 >        try (PoolCleaner cleaner = cleaner(p, done)) {
380              assertEquals(0, p.getPoolSize());
381 +            final CountDownLatch threadStarted = new CountDownLatch(1);
382              p.execute(new CheckedRunnable() {
383                  public void realRun() throws InterruptedException {
384                      threadStarted.countDown();
385                      assertEquals(1, p.getPoolSize());
386 <                    done.await();
386 >                    await(done);
387                  }});
388 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
388 >            await(threadStarted);
389              assertEquals(1, p.getPoolSize());
393            done.countDown();   // release pool
390          }
391      }
392  
# Line 411 | Line 407 | public class ThreadPoolExecutorTest exte
407              p.execute(new CheckedRunnable() {
408                  public void realRun() throws InterruptedException {
409                      threadStarted.countDown();
410 <                    done.await();
410 >                    await(done);
411                  }});
412 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
412 >            await(threadStarted);
413              assertEquals(1, p.getTaskCount());
414              assertEquals(0, p.getCompletedTaskCount());
415              for (int i = 0; i < TASKS; i++) {
# Line 422 | Line 418 | public class ThreadPoolExecutorTest exte
418                      public void realRun() throws InterruptedException {
419                          threadStarted.countDown();
420                          assertEquals(1 + TASKS, p.getTaskCount());
421 <                        done.await();
421 >                        await(done);
422                      }});
423              }
424              assertEquals(1 + TASKS, p.getTaskCount());
# Line 495 | Line 491 | public class ThreadPoolExecutorTest exte
491                  public void realRun() throws InterruptedException {
492                      assertFalse(p.isTerminating());
493                      threadStarted.countDown();
494 <                    done.await();
494 >                    await(done);
495                  }});
496 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
496 >            await(threadStarted);
497              assertFalse(p.isTerminating());
498              done.countDown();
499              try { p.shutdown(); } catch (SecurityException ok) { return; }
# Line 523 | Line 519 | public class ThreadPoolExecutorTest exte
519                  public void realRun() throws InterruptedException {
520                      assertFalse(p.isTerminating());
521                      threadStarted.countDown();
522 <                    done.await();
522 >                    await(done);
523                  }});
524 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
524 >            await(threadStarted);
525              assertFalse(p.isTerminating());
526              done.countDown();
527              try { p.shutdown(); } catch (SecurityException ok) { return; }
# Line 539 | Line 535 | public class ThreadPoolExecutorTest exte
535       * getQueue returns the work queue, which contains queued tasks
536       */
537      public void testGetQueue() throws InterruptedException {
538 +        final CountDownLatch done = new CountDownLatch(1);
539          final BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10);
540          final ThreadPoolExecutor p =
541              new ThreadPoolExecutor(1, 1,
542                                     LONG_DELAY_MS, MILLISECONDS,
543                                     q);
544 <        try (PoolCleaner cleaner = cleaner(p)) {
544 >        try (PoolCleaner cleaner = cleaner(p, done)) {
545              final CountDownLatch threadStarted = new CountDownLatch(1);
549            final CountDownLatch done = new CountDownLatch(1);
546              FutureTask[] tasks = new FutureTask[5];
547              for (int i = 0; i < tasks.length; i++) {
548                  Callable task = new CheckedCallable<Boolean>() {
549                      public Boolean realCall() throws InterruptedException {
550                          threadStarted.countDown();
551                          assertSame(q, p.getQueue());
552 <                        done.await();
552 >                        await(done);
553                          return Boolean.TRUE;
554                      }};
555                  tasks[i] = new FutureTask(task);
556                  p.execute(tasks[i]);
557              }
558 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
558 >            await(threadStarted);
559              assertSame(q, p.getQueue());
560              assertFalse(q.contains(tasks[0]));
561              assertTrue(q.contains(tasks[tasks.length - 1]));
562              assertEquals(tasks.length - 1, q.size());
567            done.countDown();
563          }
564      }
565  
# Line 572 | Line 567 | public class ThreadPoolExecutorTest exte
567       * remove(task) removes queued task, and fails to remove active task
568       */
569      public void testRemove() throws InterruptedException {
570 +        final CountDownLatch done = new CountDownLatch(1);
571          BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10);
572          final ThreadPoolExecutor p =
573              new ThreadPoolExecutor(1, 1,
574                                     LONG_DELAY_MS, MILLISECONDS,
575                                     q);
576 <        try (PoolCleaner cleaner = cleaner(p)) {
576 >        try (PoolCleaner cleaner = cleaner(p, done)) {
577              Runnable[] tasks = new Runnable[6];
578              final CountDownLatch threadStarted = new CountDownLatch(1);
583            final CountDownLatch done = new CountDownLatch(1);
579              for (int i = 0; i < tasks.length; i++) {
580                  tasks[i] = new CheckedRunnable() {
581                      public void realRun() throws InterruptedException {
582                          threadStarted.countDown();
583 <                        done.await();
583 >                        await(done);
584                      }};
585                  p.execute(tasks[i]);
586              }
587 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
587 >            await(threadStarted);
588              assertFalse(p.remove(tasks[0]));
589              assertTrue(q.contains(tasks[4]));
590              assertTrue(q.contains(tasks[3]));
# Line 599 | Line 594 | public class ThreadPoolExecutorTest exte
594              assertTrue(q.contains(tasks[3]));
595              assertTrue(p.remove(tasks[3]));
596              assertFalse(q.contains(tasks[3]));
602            done.countDown();
597          }
598      }
599  
# Line 620 | Line 614 | public class ThreadPoolExecutorTest exte
614                  Callable task = new CheckedCallable<Boolean>() {
615                      public Boolean realCall() throws InterruptedException {
616                          threadStarted.countDown();
617 <                        done.await();
617 >                        await(done);
618                          return Boolean.TRUE;
619                      }};
620                  tasks[i] = new FutureTask(task);
621                  p.execute(tasks[i]);
622              }
623 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
623 >            await(threadStarted);
624              assertEquals(tasks.length, p.getTaskCount());
625              assertEquals(tasks.length - 1, q.size());
626              assertEquals(1L, p.getActiveCount());
# Line 664 | Line 658 | public class ThreadPoolExecutorTest exte
658          }};
659          for (int i = 0; i < count; i++)
660              p.execute(waiter);
661 <        assertTrue(threadsStarted.await(LONG_DELAY_MS, MILLISECONDS));
661 >        await(threadsStarted);
662          assertEquals(poolSize, p.getActiveCount());
663          assertEquals(0, p.getCompletedTaskCount());
664          final List<Runnable> queuedTasks;
# Line 1026 | Line 1020 | public class ThreadPoolExecutorTest exte
1020       * get of submitted callable throws InterruptedException if interrupted
1021       */
1022      public void testInterruptedSubmit() throws InterruptedException {
1023 +        final CountDownLatch done = new CountDownLatch(1);
1024          final ThreadPoolExecutor p =
1025              new ThreadPoolExecutor(1, 1,
1026                                     60, SECONDS,
1027                                     new ArrayBlockingQueue<Runnable>(10));
1028  
1029 <        try (PoolCleaner cleaner = cleaner(p)) {
1029 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1030              final CountDownLatch threadStarted = new CountDownLatch(1);
1036            final CountDownLatch done = new CountDownLatch(1);
1031              Thread t = newStartedThread(new CheckedInterruptedRunnable() {
1032                  public void realRun() throws Exception {
1033                      Callable task = new CheckedCallable<Boolean>() {
1034                          public Boolean realCall() throws InterruptedException {
1035                              threadStarted.countDown();
1036 <                            done.await();
1036 >                            await(done);
1037                              return Boolean.TRUE;
1038                          }};
1039                      p.submit(task).get();
1040                  }});
1041  
1042 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
1042 >            await(threadStarted);
1043              t.interrupt();
1044 <            awaitTermination(t, MEDIUM_DELAY_MS);
1051 <            done.countDown();
1044 >            awaitTermination(t);
1045          }
1046      }
1047  
# Line 1056 | Line 1049 | public class ThreadPoolExecutorTest exte
1049       * execute throws RejectedExecutionException if saturated.
1050       */
1051      public void testSaturatedExecute() {
1052 +        final CountDownLatch done = new CountDownLatch(1);
1053          final ThreadPoolExecutor p =
1054              new ThreadPoolExecutor(1, 1,
1055                                     LONG_DELAY_MS, MILLISECONDS,
1056                                     new ArrayBlockingQueue<Runnable>(1));
1057 <        try (PoolCleaner cleaner = cleaner(p)) {
1064 <            final CountDownLatch done = new CountDownLatch(1);
1057 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1058              Runnable task = new CheckedRunnable() {
1059                  public void realRun() throws InterruptedException {
1060 <                    done.await();
1060 >                    await(done);
1061                  }};
1062              for (int i = 0; i < 2; ++i)
1063                  p.execute(task);
# Line 1075 | Line 1068 | public class ThreadPoolExecutorTest exte
1068                  } catch (RejectedExecutionException success) {}
1069                  assertTrue(p.getTaskCount() <= 2);
1070              }
1078            done.countDown();
1071          }
1072      }
1073  
# Line 1083 | Line 1075 | public class ThreadPoolExecutorTest exte
1075       * submit(runnable) throws RejectedExecutionException if saturated.
1076       */
1077      public void testSaturatedSubmitRunnable() {
1078 +        final CountDownLatch done = new CountDownLatch(1);
1079          final ThreadPoolExecutor p =
1080              new ThreadPoolExecutor(1, 1,
1081                                     LONG_DELAY_MS, MILLISECONDS,
1082                                     new ArrayBlockingQueue<Runnable>(1));
1083 <        try (PoolCleaner cleaner = cleaner(p)) {
1091 <            final CountDownLatch done = new CountDownLatch(1);
1083 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1084              Runnable task = new CheckedRunnable() {
1085                  public void realRun() throws InterruptedException {
1086 <                    done.await();
1086 >                    await(done);
1087                  }};
1088              for (int i = 0; i < 2; ++i)
1089                  p.submit(task);
# Line 1102 | Line 1094 | public class ThreadPoolExecutorTest exte
1094                  } catch (RejectedExecutionException success) {}
1095                  assertTrue(p.getTaskCount() <= 2);
1096              }
1105            done.countDown();
1097          }
1098      }
1099  
# Line 1110 | Line 1101 | public class ThreadPoolExecutorTest exte
1101       * submit(callable) throws RejectedExecutionException if saturated.
1102       */
1103      public void testSaturatedSubmitCallable() {
1104 +        final CountDownLatch done = new CountDownLatch(1);
1105          final ThreadPoolExecutor p =
1106              new ThreadPoolExecutor(1, 1,
1107                                     LONG_DELAY_MS, MILLISECONDS,
1108                                     new ArrayBlockingQueue<Runnable>(1));
1109 <        try (PoolCleaner cleaner = cleaner(p)) {
1118 <            final CountDownLatch done = new CountDownLatch(1);
1109 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1110              Runnable task = new CheckedRunnable() {
1111                  public void realRun() throws InterruptedException {
1112 <                    done.await();
1112 >                    await(done);
1113                  }};
1114              for (int i = 0; i < 2; ++i)
1115                  p.submit(Executors.callable(task));
# Line 1129 | Line 1120 | public class ThreadPoolExecutorTest exte
1120                  } catch (RejectedExecutionException success) {}
1121                  assertTrue(p.getTaskCount() <= 2);
1122              }
1132            done.countDown();
1123          }
1124      }
1125  
# Line 1147 | Line 1137 | public class ThreadPoolExecutorTest exte
1137              final CountDownLatch done = new CountDownLatch(1);
1138              Runnable blocker = new CheckedRunnable() {
1139                  public void realRun() throws InterruptedException {
1140 <                    done.await();
1140 >                    await(done);
1141                  }};
1142              p.execute(blocker);
1143              TrackedNoOpRunnable[] tasks = new TrackedNoOpRunnable[5];
# Line 1166 | Line 1156 | public class ThreadPoolExecutorTest exte
1156       * executor using DiscardPolicy drops task if saturated.
1157       */
1158      public void testSaturatedExecute3() {
1159 +        final CountDownLatch done = new CountDownLatch(1);
1160          final TrackedNoOpRunnable[] tasks = new TrackedNoOpRunnable[5];
1161          for (int i = 0; i < tasks.length; ++i)
1162              tasks[i] = new TrackedNoOpRunnable();
# Line 1174 | Line 1165 | public class ThreadPoolExecutorTest exte
1165                            LONG_DELAY_MS, MILLISECONDS,
1166                            new ArrayBlockingQueue<Runnable>(1),
1167                            new ThreadPoolExecutor.DiscardPolicy());
1168 <        try (PoolCleaner cleaner = cleaner(p)) {
1178 <            final CountDownLatch done = new CountDownLatch(1);
1168 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1169              p.execute(awaiter(done));
1170  
1171              for (TrackedNoOpRunnable task : tasks)
1172                  p.execute(task);
1173              for (int i = 1; i < tasks.length; i++)
1174                  assertFalse(tasks[i].done);
1185            done.countDown();
1175          }
1176          for (int i = 1; i < tasks.length; i++)
1177              assertFalse(tasks[i].done);
# Line 1202 | Line 1191 | public class ThreadPoolExecutorTest exte
1191                                     LONG_DELAY_MS, MILLISECONDS,
1192                                     new ArrayBlockingQueue<Runnable>(1),
1193                                     new ThreadPoolExecutor.DiscardOldestPolicy());
1194 <        try (PoolCleaner cleaner = cleaner(p)) {
1194 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1195              assertEquals(LatchAwaiter.NEW, r1.state);
1196              assertEquals(LatchAwaiter.NEW, r2.state);
1197              assertEquals(LatchAwaiter.NEW, r3.state);
# Line 1212 | Line 1201 | public class ThreadPoolExecutorTest exte
1201              p.execute(r3);
1202              assertFalse(p.getQueue().contains(r2));
1203              assertTrue(p.getQueue().contains(r3));
1215            done.countDown();
1204          }
1205          assertEquals(LatchAwaiter.DONE, r1.state);
1206          assertEquals(LatchAwaiter.NEW, r2.state);
# Line 1738 | Line 1726 | public class ThreadPoolExecutorTest exte
1726                                     LONG_DELAY_MS, MILLISECONDS,
1727                                     new ArrayBlockingQueue<Runnable>(10));
1728          try (PoolCleaner cleaner = cleaner(e)) {
1729 +            long startTime = System.nanoTime();
1730              List<Callable<String>> l = new ArrayList<Callable<String>>();
1731              l.add(new NPETask());
1732              try {
1733 <                e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
1733 >                e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
1734                  shouldThrow();
1735              } catch (ExecutionException success) {
1736                  assertTrue(success.getCause() instanceof NullPointerException);
1737              }
1738 +            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1739          }
1740      }
1741  
# Line 1758 | Line 1748 | public class ThreadPoolExecutorTest exte
1748                                     LONG_DELAY_MS, MILLISECONDS,
1749                                     new ArrayBlockingQueue<Runnable>(10));
1750          try (PoolCleaner cleaner = cleaner(e)) {
1751 +            long startTime = System.nanoTime();
1752              List<Callable<String>> l = new ArrayList<Callable<String>>();
1753              l.add(new StringTask());
1754              l.add(new StringTask());
1755 <            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
1755 >            String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
1756              assertSame(TEST_STRING, result);
1757 +            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1758          }
1759      }
1760  
# Line 1846 | Line 1838 | public class ThreadPoolExecutorTest exte
1838              List<Callable<String>> l = new ArrayList<Callable<String>>();
1839              l.add(new NPETask());
1840              List<Future<String>> futures =
1841 <                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
1841 >                e.invokeAll(l, LONG_DELAY_MS, MILLISECONDS);
1842              assertEquals(1, futures.size());
1843              try {
1844                  futures.get(0).get();
# Line 1881 | Line 1873 | public class ThreadPoolExecutorTest exte
1873       * timed invokeAll(c) cancels tasks not completed by timeout
1874       */
1875      public void testTimedInvokeAll6() throws Exception {
1876 <        final ExecutorService e =
1877 <            new ThreadPoolExecutor(2, 2,
1878 <                                   LONG_DELAY_MS, MILLISECONDS,
1879 <                                   new ArrayBlockingQueue<Runnable>(10));
1880 <        try (PoolCleaner cleaner = cleaner(e)) {
1881 <            for (long timeout = timeoutMillis();;) {
1876 >        for (long timeout = timeoutMillis();;) {
1877 >            final CountDownLatch done = new CountDownLatch(1);
1878 >            final Callable<String> waiter = new CheckedCallable<String>() {
1879 >                public String realCall() {
1880 >                    try { done.await(LONG_DELAY_MS, MILLISECONDS); }
1881 >                    catch (InterruptedException ok) {}
1882 >                    return "1"; }};
1883 >            final ExecutorService p =
1884 >                new ThreadPoolExecutor(2, 2,
1885 >                                       LONG_DELAY_MS, MILLISECONDS,
1886 >                                       new ArrayBlockingQueue<Runnable>(10));
1887 >            try (PoolCleaner cleaner = cleaner(p, done)) {
1888                  List<Callable<String>> tasks = new ArrayList<>();
1889                  tasks.add(new StringTask("0"));
1890 <                tasks.add(Executors.callable(new LongPossiblyInterruptedRunnable(), TEST_STRING));
1890 >                tasks.add(waiter);
1891                  tasks.add(new StringTask("2"));
1892                  long startTime = System.nanoTime();
1893                  List<Future<String>> futures =
1894 <                    e.invokeAll(tasks, timeout, MILLISECONDS);
1894 >                    p.invokeAll(tasks, timeout, MILLISECONDS);
1895                  assertEquals(tasks.size(), futures.size());
1896                  assertTrue(millisElapsedSince(startTime) >= timeout);
1897                  for (Future future : futures)
# Line 2031 | Line 2029 | public class ThreadPoolExecutorTest exte
2029       * get(cancelled task) throws CancellationException
2030       */
2031      public void testGet_cancelled() throws Exception {
2032 +        final CountDownLatch done = new CountDownLatch(1);
2033          final ExecutorService e =
2034              new ThreadPoolExecutor(1, 1,
2035                                     LONG_DELAY_MS, MILLISECONDS,
2036                                     new LinkedBlockingQueue<Runnable>());
2037 <        try (PoolCleaner cleaner = cleaner(e)) {
2037 >        try (PoolCleaner cleaner = cleaner(e, done)) {
2038              final CountDownLatch blockerStarted = new CountDownLatch(1);
2040            final CountDownLatch done = new CountDownLatch(1);
2039              final List<Future<?>> futures = new ArrayList<>();
2040              for (int i = 0; i < 2; i++) {
2041                  Runnable r = new CheckedRunnable() { public void realRun()
# Line 2047 | Line 2045 | public class ThreadPoolExecutorTest exte
2045                  }};
2046                  futures.add(e.submit(r));
2047              }
2048 <            assertTrue(blockerStarted.await(LONG_DELAY_MS, MILLISECONDS));
2048 >            await(blockerStarted);
2049              for (Future<?> future : futures) future.cancel(false);
2050              for (Future<?> future : futures) {
2051                  try {
# Line 2061 | Line 2059 | public class ThreadPoolExecutorTest exte
2059                  assertTrue(future.isCancelled());
2060                  assertTrue(future.isDone());
2061              }
2064            done.countDown();
2062          }
2063      }
2064  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines