From 7986b8248f02291f579bef87ef442d6dda9a4369 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sat, 9 Jan 2016 22:42:46 +0000 Subject: [PATCH] SOLR-8468: Raise some test zk connection timeouts up from 10 seconds and remove some test timeout magic numbers. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1723888 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/org/apache/solr/cloud/TestConfigSetsAPI.java | 6 +++--- .../org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java | 2 +- .../org/apache/solr/cloud/TestMiniSolrCloudCluster.java | 4 ++-- .../org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java | 2 +- .../org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java | 2 +- .../cloud/VMParamsZkACLAndCredentialsProvidersTest.java | 2 +- .../apache/solr/cloud/AbstractFullDistribZkTestBase.java | 2 +- .../src/java/org/apache/solr/cloud/AbstractZkTestCase.java | 4 ++-- .../java/org/apache/solr/cloud/MiniSolrCloudCluster.java | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java index 33e1f4ababc..d9290b64ca1 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java @@ -149,7 +149,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 { setupBaseConfigSet(baseConfigSetName, oldProps); SolrZkClient zkClient = new SolrZkClient(solrCluster.getZkServer().getZkAddress(), - AbstractZkTestCase.TIMEOUT, 45000, null); + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); try { ZkConfigManager configManager = new ZkConfigManager(zkClient); assertFalse(configManager.configExists(configSetName)); @@ -282,7 +282,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 { solrCluster.uploadConfigDir(configDir, configSet); SolrZkClient zkClient = new SolrZkClient(solrCluster.getZkServer().getZkAddress(), - AbstractZkTestCase.TIMEOUT, 45000, null); + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); try { ZkConfigManager configManager = new ZkConfigManager(zkClient); assertTrue(configManager.configExists(configSet)); @@ -305,7 +305,7 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 { new HttpSolrClient(solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString()); SolrZkClient zkClient = new SolrZkClient(solrCluster.getZkServer().getZkAddress(), - AbstractZkTestCase.TIMEOUT, 45000, null); + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); try { // test empty List list = new List(); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java index 55adcfdea82..36ad2ffeede 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIZkFailure.java @@ -107,7 +107,7 @@ public class TestConfigSetsAPIZkFailure extends SolrTestCaseJ4 { setupBaseConfigSet(BASE_CONFIGSET_NAME, oldProps); SolrZkClient zkClient = new SolrZkClient(solrCluster.getZkServer().getZkAddress(), - AbstractZkTestCase.TIMEOUT, 45000, null); + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); try { ZkConfigManager configManager = new ZkConfigManager(zkClient); assertFalse(configManager.configExists(CONFIGSET_NAME)); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java index 061478a94a9..636fe5d1a54 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudCluster.java @@ -303,7 +303,7 @@ public class TestMiniSolrCloudCluster extends LuceneTestCase { } try (SolrZkClient zkClient = new SolrZkClient - (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, 45000, null); + (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); ZkStateReader zkStateReader = new ZkStateReader(zkClient)) { // wait for collection to appear @@ -350,7 +350,7 @@ public class TestMiniSolrCloudCluster extends LuceneTestCase { final SolrInputDocument doc = new SolrInputDocument(); try (SolrZkClient zkClient = new SolrZkClient - (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, 45000, null); + (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); ZkStateReader zkStateReader = new ZkStateReader(zkClient)) { AbstractDistribZkTestBase.waitForRecoveriesToFinish(collectionName, zkStateReader, true, true, 330); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java index 60a9e880781..3c39a1bfb83 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterBase.java @@ -133,7 +133,7 @@ public class TestMiniSolrCloudClusterBase extends LuceneTestCase { } try (SolrZkClient zkClient = new SolrZkClient - (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, 45000, null); + (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); ZkStateReader zkStateReader = new ZkStateReader(zkClient)) { AbstractDistribZkTestBase.waitForRecoveriesToFinish(collectionName, zkStateReader, true, true, 330); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java index f6a30c751fb..5071f398580 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithKerberosAlt.java @@ -194,7 +194,7 @@ public class TestSolrCloudWithKerberosAlt extends LuceneTestCase { createRequest.process(cloudSolrClient); try (SolrZkClient zkClient = new SolrZkClient - (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, 45000, null); + (miniCluster.getZkServer().getZkAddress(), AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); ZkStateReader zkStateReader = new ZkStateReader(zkClient)) { AbstractDistribZkTestBase.waitForRecoveriesToFinish(collectionName, zkStateReader, true, true, 330); diff --git a/solr/core/src/test/org/apache/solr/cloud/VMParamsZkACLAndCredentialsProvidersTest.java b/solr/core/src/test/org/apache/solr/cloud/VMParamsZkACLAndCredentialsProvidersTest.java index c1c93a9eed8..f24a798e4b7 100644 --- a/solr/core/src/test/org/apache/solr/cloud/VMParamsZkACLAndCredentialsProvidersTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/VMParamsZkACLAndCredentialsProvidersTest.java @@ -70,7 +70,7 @@ public class VMParamsZkACLAndCredentialsProvidersTest extends SolrTestCaseJ4 { setSecuritySystemProperties(); SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), - AbstractZkTestCase.TIMEOUT, 60000, null, null, null); + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null, null, null); zkClient.makePath("/solr", false, true); zkClient.close(); diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java index 3f66b04b18b..0aadc3edc2f 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java @@ -1323,7 +1323,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes // do some really inefficient mapping... Map slices = null; ClusterState clusterState; - try (ZkStateReader zk = new ZkStateReader(zkServer.getZkAddress(), 10000, + try (ZkStateReader zk = new ZkStateReader(zkServer.getZkAddress(), AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT)) { zk.createClusterStateWatchersAndUpdate(); clusterState = zk.getClusterState(); diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java index 7b54495b6f5..5daa5ecc296 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java @@ -38,7 +38,7 @@ import java.util.Map; public abstract class AbstractZkTestCase extends SolrTestCaseJ4 { private static final String ZOOKEEPER_FORCE_SYNC = "zookeeper.forceSync"; - public static final int TIMEOUT = 10000; + public static final int TIMEOUT = 45000; private static final boolean DEBUG = false; @@ -86,7 +86,7 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 { // static to share with distrib test public static void buildZooKeeper(String zkHost, String zkAddress, File solrhome, String config, String schema) throws Exception { - SolrZkClient zkClient = new SolrZkClient(zkHost, AbstractZkTestCase.TIMEOUT, 45000, null); + SolrZkClient zkClient = new SolrZkClient(zkHost, AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null); zkClient.makePath("/solr", false, true); zkClient.close(); diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java index 205ce8178da..1cfbe8483d6 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java @@ -195,7 +195,7 @@ public class MiniSolrCloudCluster { this.zkServer = zkTestServer; try(SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), - AbstractZkTestCase.TIMEOUT, 45000, null)) { + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null)) { zkClient.makePath("/solr/solr.xml", solrXml.getBytes(Charset.defaultCharset()), true); if (jettyConfig.sslConfig != null && jettyConfig.sslConfig.isSSLMode()) { zkClient.makePath("/solr" + ZkStateReader.CLUSTER_PROPS, "{'urlScheme':'https'}".getBytes(Charsets.UTF_8), true); @@ -366,7 +366,7 @@ public class MiniSolrCloudCluster { public void uploadConfigDir(File configDir, String configName) throws IOException, KeeperException, InterruptedException { try(SolrZkClient zkClient = new SolrZkClient(zkServer.getZkAddress(), - AbstractZkTestCase.TIMEOUT, 45000, null)) { + AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT, null)) { ZkConfigManager manager = new ZkConfigManager(zkClient); manager.uploadConfigDir(configDir.toPath(), configName); }