Skip to content

Commit

Permalink
HIVE-8965 - Enhance PTest to kill all processes between tests and to …
Browse files Browse the repository at this point in the history
…report when a TEST*.xml file is not generated (Brock reviewed by Szehon)

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1641745 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Brock Noland committed Nov 26, 2014
1 parent 8d722e4 commit aabdf2a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected List<SSHResult> execHostsIgnoreErrors(String command)
for(HostExecutor hostExecutor : hostExecutors) {
futures.add(hostExecutor.execIgnoreAllErrors(command));
}
return toListOfResults(futures);
return toListOfResults(futures, false);
}
// clean prep
protected List<RemoteCommandResult> execInstances(String command)
Expand Down Expand Up @@ -167,10 +167,15 @@ private <T extends RemoteCommandResult> List<T> flatten(List<ListenableFuture<Li
}
private <T extends RemoteCommandResult> List<T> toListOfResults(List<ListenableFuture<T>> futures)
throws Exception {
return toListOfResults(futures, true);
}
private <T extends RemoteCommandResult> List<T> toListOfResults(List<ListenableFuture<T>> futures,
boolean reportErrors)
throws Exception {
List<T> results = Lists.newArrayList();
for(T result : Futures.allAsList(futures).get()) {
if(result != null) {
if(result.getException() != null || result.getExitCode() != 0) {
if(reportErrors && (result.getException() != null || result.getExitCode() != 0)) {
throw new SSHExecutionException(result);
}
results.add(result);
Expand Down

0 comments on commit aabdf2a

Please sign in to comment.