geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [21/50] [abbrv] incubator-geode git commit: GEODE-979 CI Failure: ParameterBindingJUnitTest.testMultithreadedBindUsingSameQueryObject failed with NullPointerException
Date Thu, 25 Feb 2016 20:27:09 GMT
GEODE-979 CI Failure: ParameterBindingJUnitTest.testMultithreadedBindUsingSameQueryObject failed
with NullPointerException

LinkedList should not be added to concurrently
Moved some of the latch logic to guarantee that all threads are queued before starting
Added an awaitTerminate call to make sure all threads are done working before returning results


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d50623b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d50623b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d50623b0

Branch: refs/heads/feature/GEODE-17
Commit: d50623b04f253b51182114c9fd277db20afeba8b
Parents: 4951bfa
Author: Jason Huynh <huynhja@gmail.com>
Authored: Wed Feb 24 14:05:08 2016 -0800
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Wed Feb 24 14:58:09 2016 -0800

----------------------------------------------------------------------
 .../gemstone/gemfire/cache/query/MultithreadedTester.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d50623b0/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java
b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java
index 3142566..adea4a3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/MultithreadedTester.java
@@ -31,14 +31,15 @@ public class MultithreadedTester {
 
   
   public static Collection<Object> runMultithreaded(Collection<Callable> callables)
throws InterruptedException {
-    final CountDownLatch allRunnablesAreSubmitted = new CountDownLatch(1);
+    final CountDownLatch allRunnablesAreSubmitted = new CountDownLatch(callables.size());
     final CountDownLatch callablesComplete = new CountDownLatch(callables.size());
     final ExecutorService executor = Executors.newFixedThreadPool(callables.size());
     final LinkedList<Future> futures = new LinkedList<>();
     //Submit all tasks to the executor
-    callables.parallelStream().forEach(callable -> {
+    callables.forEach(callable -> {
       futures.add(executor.submit(() -> {
         try {
+          allRunnablesAreSubmitted.countDown();
           allRunnablesAreSubmitted.await(60, TimeUnit.SECONDS);
           return callable.call();
         }
@@ -50,11 +51,10 @@ public class MultithreadedTester {
         }
       }));
     });
-    //Unlock all tasks
-    allRunnablesAreSubmitted.countDown();
     //Wait until all tasks are complete
     callablesComplete.await(60, TimeUnit.SECONDS);
     executor.shutdown();
+    executor.awaitTermination(60, TimeUnit.SECONDS);
     return convertFutureToResult(futures);
   }
 


Mime
View raw message