be careful when shutting down - in some cases in tests we did not yet fully start up

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1175862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2011-09-26 13:31:37 +00:00
parent c9637196ae
commit f5d625821f
1 changed files with 6 additions and 2 deletions

View File

@ -113,8 +113,12 @@ public class ZkTestServer {
if (zkDb != null) {
zkDb.close();
}
waitForServerDown(getZkHost() + ":" + getPort(), 5000);
cnxnFactory.shutdown();
if (cnxnFactory != null && cnxnFactory.getLocalPort() != 0) {
waitForServerDown(getZkHost() + ":" + getPort(), 5000);
}
if (cnxnFactory != null) {
cnxnFactory.shutdown();
}
}
public int getLocalPort() {