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.103 by jsr166, Mon Oct 5 22:19:00 2015 UTC vs.
Revision 1.105 by jsr166, Tue Oct 6 00:41:47 2015 UTC

# Line 1024 | Line 1024 | public class ThreadPoolExecutorTest exte
1024       * get of submitted callable throws InterruptedException if interrupted
1025       */
1026      public void testInterruptedSubmit() throws InterruptedException {
1027 +        final CountDownLatch done = new CountDownLatch(1);
1028          final ThreadPoolExecutor p =
1029              new ThreadPoolExecutor(1, 1,
1030                                     60, SECONDS,
1031                                     new ArrayBlockingQueue<Runnable>(10));
1032  
1033 <        try (PoolCleaner cleaner = cleaner(p)) {
1033 >        try (PoolCleaner cleaner = cleaner(p, done)) {
1034              final CountDownLatch threadStarted = new CountDownLatch(1);
1034            final CountDownLatch done = new CountDownLatch(1);
1035              Thread t = newStartedThread(new CheckedInterruptedRunnable() {
1036                  public void realRun() throws Exception {
1037                      Callable task = new CheckedCallable<Boolean>() {
# Line 1043 | Line 1043 | public class ThreadPoolExecutorTest exte
1043                      p.submit(task).get();
1044                  }});
1045  
1046 <            assertTrue(threadStarted.await(LONG_DELAY_MS, MILLISECONDS));
1046 >            await(threadStarted);
1047              t.interrupt();
1048 <            awaitTermination(t, MEDIUM_DELAY_MS);
1049 <            done.countDown();
1048 >            awaitTermination(t);
1049          }
1050      }
1051  
# Line 1844 | Line 1843 | public class ThreadPoolExecutorTest exte
1843              List<Callable<String>> l = new ArrayList<Callable<String>>();
1844              l.add(new NPETask());
1845              List<Future<String>> futures =
1846 <                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
1846 >                e.invokeAll(l, LONG_DELAY_MS, MILLISECONDS);
1847              assertEquals(1, futures.size());
1848              try {
1849                  futures.get(0).get();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines