From 16a1a6f76ff388cbf336c85d87324815cf21b24b Mon Sep 17 00:00:00 2001 From: Tomas Fernandez Lobbe Date: Wed, 5 Jul 2017 14:01:24 -0700 Subject: [PATCH] SOLR-11015: Use a higher socket timeout for creating testcollection in ChaosMonkeyNothingIsSafe* --- .../apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java | 8 ++++++-- .../ChaosMonkeyNothingIsSafeWithPullReplicasTest.java | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java index 522f4ddd252..f8a13624209 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java @@ -102,7 +102,11 @@ public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase @Override protected CloudSolrClient createCloudClient(String defaultCollection) { - CloudSolrClient client = getCloudSolrClient(zkServer.getZkAddress(), random().nextBoolean(), 30000, clientSoTimeout); + return this.createCloudClient(defaultCollection, this.clientSoTimeout); + } + + protected CloudSolrClient createCloudClient(String defaultCollection, int socketTimeout) { + CloudSolrClient client = getCloudSolrClient(zkServer.getZkAddress(), random().nextBoolean(), 30000, socketTimeout); client.setParallelUpdates(random().nextBoolean()); if (defaultCollection != null) client.setDefaultCollection(defaultCollection); return client; @@ -250,7 +254,7 @@ public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase restartZk(1000 * (5 + random().nextInt(4))); } - try (CloudSolrClient client = createCloudClient("collection1")) { + try (CloudSolrClient client = createCloudClient("collection1", 30000)) { createCollection(null, "testcollection", 1, 1, 1, client, null, "conf1"); diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java index 2e5aa7d15e4..64c042db59a 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java @@ -125,7 +125,11 @@ public class ChaosMonkeyNothingIsSafeWithPullReplicasTest extends AbstractFullDi @Override protected CloudSolrClient createCloudClient(String defaultCollection) { - CloudSolrClient client = getCloudSolrClient(zkServer.getZkAddress(), random().nextBoolean(), 30000, clientSoTimeout); + return this.createCloudClient(defaultCollection, this.clientSoTimeout); + } + + protected CloudSolrClient createCloudClient(String defaultCollection, int socketTimeout) { + CloudSolrClient client = getCloudSolrClient(zkServer.getZkAddress(), random().nextBoolean(), 30000, socketTimeout); client.setParallelUpdates(random().nextBoolean()); if (defaultCollection != null) client.setDefaultCollection(defaultCollection); return client; @@ -292,7 +296,7 @@ public class ChaosMonkeyNothingIsSafeWithPullReplicasTest extends AbstractFullDi restartZk(1000 * (5 + random().nextInt(4))); } - try (CloudSolrClient client = createCloudClient("collection1")) { + try (CloudSolrClient client = createCloudClient("collection1", 30000)) { // We don't really know how many live nodes we have at this point, so "maxShardsPerNode" needs to be > 1 createCollection(null, "testcollection", 1, 1, 10, client, null, "conf1");