Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,28 @@ protected Client getClient() {

@After
public void tearDown() {
Exception firstFailure = null;

if (remoteClusterInfo != null) {
try {
remoteClusterHelper.stopCluster();
} catch (Exception e) {
log.error("Failed to stop remote cluster {}.", remoteClusterInfo.clustername, e);
Assert.fail("Failed to stop remote cluster " + remoteClusterInfo.clustername + ".");
firstFailure = e;
}
remoteClusterInfo = null;
}

if (clusterInfo != null) {
try {
clusterHelper.stopCluster();
} catch (Exception e) {
log.error("Failed to stop cluster {}.", clusterInfo.clustername, e);
Assert.fail("Failed to stop cluster " + clusterInfo.clustername + ".");
}
clusterInfo = null;
try {
clusterHelper.stopCluster();
} catch (Exception e) {
log.error("Failed to stop cluster.", e);
if (firstFailure == null) firstFailure = e;
}
clusterInfo = null;

if (firstFailure != null) {
Assert.fail("Cluster cleanup failed: " + firstFailure.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ public void run() {
latch.await();

if (err.get() != null) {
closeAllNodes();
throw new RuntimeException("Could not start all nodes " + err.get(), err.get());
}

Expand Down Expand Up @@ -342,7 +343,7 @@ private void closeAllNodes() throws Exception {
private static void closeNode(Node node) {
try {
node.close();
node.awaitClose(250, TimeUnit.MILLISECONDS);
node.awaitClose(5, TimeUnit.SECONDS);
} catch (Throwable e) {
// ignore
}
Expand Down
Loading