mirror of https://github.com/apache/lucene.git
it's possible to get an NPE here on shutdown in tests
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1175656 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
44b56415a8
commit
68d098fbef
|
@ -35,6 +35,7 @@ import org.apache.solr.SolrTestCaseJ4;
|
|||
import org.apache.zookeeper.jmx.ManagedUtil;
|
||||
import org.apache.zookeeper.server.NIOServerCnxn;
|
||||
import org.apache.zookeeper.server.ServerConfig;
|
||||
import org.apache.zookeeper.server.ZKDatabase;
|
||||
import org.apache.zookeeper.server.ZooKeeperServer;
|
||||
import org.apache.zookeeper.server.SessionTracker.Session;
|
||||
import org.apache.zookeeper.server.persistence.FileTxnSnapLog;
|
||||
|
@ -108,7 +109,10 @@ public class ZkTestServer {
|
|||
*/
|
||||
protected void shutdown() throws IOException {
|
||||
zooKeeperServer.shutdown();
|
||||
zooKeeperServer.getZKDatabase().close();
|
||||
ZKDatabase zkDb = zooKeeperServer.getZKDatabase();
|
||||
if (zkDb != null) {
|
||||
zkDb.close();
|
||||
}
|
||||
waitForServerDown(getZkHost() + ":" + getPort(), 5000);
|
||||
cnxnFactory.shutdown();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue