Skip to content

Commit

Permalink
launcher: spurious exception in EtcdClusterResource (fixes #494)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed Feb 6, 2019
1 parent d15c713 commit c42e5e6
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
import io.etcd.jetcd.launcher.EtcdCluster;
import io.etcd.jetcd.launcher.EtcdClusterFactory;
import org.junit.rules.ExternalResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class EtcdClusterResource extends ExternalResource {

private static final Logger LOG = LoggerFactory.getLogger(EtcdClusterResource.class);

private final EtcdCluster cluster;

public EtcdClusterResource(String clusterName) {
Expand Down Expand Up @@ -50,6 +55,10 @@ protected void before() throws Throwable {

@Override
protected void after() {
this.cluster.close();
try {
this.cluster.close();
} catch (RuntimeException e) {
LOG.warn("close() failed (but ignoring it)", e);
}
}
}

0 comments on commit c42e5e6

Please sign in to comment.