Skip to content

Commit

Permalink
adapt test code
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuehnel committed Aug 29, 2019
1 parent 983114f commit 65ecd0f
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,17 @@ public T submitTaskAndWaitForCompletion(Callable<T> task) {

public List<Future<T>> execute() {
try {
return service.invokeAll(tasks);
} catch (InterruptedException e) {
List<Future<T>> futures = service.invokeAll(tasks);
//The Following is needed to query each future at least once even
//if no particular result is needed. Otherwise exceptions that
//appeared during the execution are not caught and just silently
//ignored
//TODO: Implement utils for Runnables instead of Callables
for(Future<T> future: futures) {
future.get();
}
return futures;
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
} finally {
service.shutdownNow();
Expand Down

0 comments on commit 65ecd0f

Please sign in to comment.