mirror of https://github.com/apache/lucene.git
SOLR-5880: Start using zookeeper.forceSync=false in tests.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1579120 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
69de1dd4ab
commit
daa10a5435
|
@ -38,6 +38,10 @@ import org.junit.BeforeClass;
|
|||
|
||||
public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTestCase {
|
||||
|
||||
private static final String REMOVE_VERSION_FIELD = "remove.version.field";
|
||||
private static final String ENABLE_UPDATE_LOG = "enable.update.log";
|
||||
private static final String ZK_HOST = "zkHost";
|
||||
private static final String ZOOKEEPER_FORCE_SYNC = "zookeeper.forceSync";
|
||||
protected static final String DEFAULT_COLLECTION = "collection1";
|
||||
private static final boolean DEBUG = false;
|
||||
protected ZkTestServer zkServer;
|
||||
|
@ -61,9 +65,10 @@ public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTes
|
|||
zkServer = new ZkTestServer(zkDir);
|
||||
zkServer.run();
|
||||
|
||||
System.setProperty("zkHost", zkServer.getZkAddress());
|
||||
System.setProperty("enable.update.log", "true");
|
||||
System.setProperty("remove.version.field", "true");
|
||||
System.setProperty(ZK_HOST, zkServer.getZkAddress());
|
||||
System.setProperty(ENABLE_UPDATE_LOG, "true");
|
||||
System.setProperty(REMOVE_VERSION_FIELD, "true");
|
||||
System.setProperty(ZOOKEEPER_FORCE_SYNC, "false");
|
||||
|
||||
String schema = getSchemaFile();
|
||||
if (schema == null) schema = "schema.xml";
|
||||
|
@ -211,13 +216,15 @@ public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTes
|
|||
if (DEBUG) {
|
||||
printLayout();
|
||||
}
|
||||
System.clearProperty("zkHost");
|
||||
System.clearProperty(ZK_HOST);
|
||||
System.clearProperty("collection");
|
||||
System.clearProperty("enable.update.log");
|
||||
System.clearProperty("remove.version.field");
|
||||
System.clearProperty(ENABLE_UPDATE_LOG);
|
||||
System.clearProperty(REMOVE_VERSION_FIELD);
|
||||
System.clearProperty("solr.directoryFactory");
|
||||
System.clearProperty("solr.test.sys.prop1");
|
||||
System.clearProperty("solr.test.sys.prop2");
|
||||
System.clearProperty(ZOOKEEPER_FORCE_SYNC);
|
||||
|
||||
resetExceptionIgnores();
|
||||
super.tearDown();
|
||||
zkServer.shutdown();
|
||||
|
|
|
@ -35,7 +35,8 @@ import org.slf4j.LoggerFactory;
|
|||
* Base test class for ZooKeeper tests.
|
||||
*/
|
||||
public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
|
||||
|
||||
private static final String ZOOKEEPER_FORCE_SYNC = "zookeeper.forceSync";
|
||||
|
||||
static final int TIMEOUT = 10000;
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
|
@ -71,6 +72,7 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
|
|||
System.setProperty("solrcloud.skip.autorecovery", "true");
|
||||
System.setProperty("zkHost", zkServer.getZkAddress());
|
||||
System.setProperty("jetty.port", "0000");
|
||||
System.setProperty(ZOOKEEPER_FORCE_SYNC, "false");
|
||||
|
||||
buildZooKeeper(zkServer.getZkHost(), zkServer.getZkAddress(), SOLRHOME,
|
||||
"solrconfig.xml", "schema.xml");
|
||||
|
@ -152,6 +154,7 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
|
|||
System.clearProperty("solr.test.sys.prop2");
|
||||
System.clearProperty("solrcloud.skip.autorecovery");
|
||||
System.clearProperty("jetty.port");
|
||||
System.clearProperty(ZOOKEEPER_FORCE_SYNC);
|
||||
|
||||
zkServer.shutdown();
|
||||
|
||||
|
|
Loading…
Reference in New Issue