You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/26 14:51:21 UTC
[lucene-solr] branch reference_impl updated: @341 Tweakin' on
stellar tests.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl by this push:
new caebdc2 @341 Tweakin' on stellar tests.
caebdc2 is described below
commit caebdc2fc0bf54bcf5b161b670a5f7cd842dc80d
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Jul 26 09:51:01 2020 -0500
@341 Tweakin' on stellar tests.
---
.../src/java/org/apache/lucene/util/LuceneTestCase.java | 2 +-
.../java/org/apache/solr/handler/component/HttpShardHandler.java | 7 ++++---
.../src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java | 2 ++
.../src/test/org/apache/solr/cloud/TestRequestForwarding.java | 1 +
.../cloud/api/collections/CollectionsAPIDistributedZkTest.java | 1 +
.../test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java | 1 +
.../apache/solr/update/processor/TemplateUpdateProcessorTest.java | 4 ++--
solr/test-framework/src/java/org/apache/solr/SolrTestCase.java | 4 ----
.../src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java | 8 +++++++-
9 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index 9f2cd27..d4b715d 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -591,7 +591,7 @@ public abstract class LuceneTestCase extends Assert {
* Max 10mb of static data stored in a test suite class after the suite is complete.
* Prevents static data structures leaking and causing OOMs in subsequent tests.
*/
- private final static long STATIC_LEAK_THRESHOLD = 10 * 1024 * 1024;
+ private final static long STATIC_LEAK_THRESHOLD = 5 * 1024;
/** By-name list of ignored types like loggers etc. */
private final static Set<String> STATIC_LEAK_IGNORED_TYPES = Set.of(
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
index 0a67aac..0f2c65b 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
@@ -47,6 +47,7 @@ import org.apache.solr.client.solrj.routing.ReplicaListTransformer;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.cloud.CloudDescriptor;
import org.apache.solr.cloud.ZkController;
+import org.apache.solr.common.AlreadyClosedException;
import org.apache.solr.common.ParWork;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.cloud.ClusterState;
@@ -381,11 +382,11 @@ public class HttpShardHandler extends ShardHandler {
while (pending.size() > 0 && !Thread.currentThread().isInterrupted()) {
try {
- Future<ShardResponse> future = completionService.poll(Integer.getInteger("solr.httpShardHandler.completionTimeout", 15000), TimeUnit.MILLISECONDS);
+ Future<ShardResponse> future = completionService.poll(Integer.getInteger("solr.httpShardHandler.completionTimeout", 30000), TimeUnit.MILLISECONDS);
if (future == null) {
log.warn("Timed out waiting for response from shard");
// nocommit
- continue;
+ throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Timeout waiting for shard response");
}
pending.remove(future);
ShardResponse rsp = future.get();
@@ -400,7 +401,7 @@ public class HttpShardHandler extends ShardHandler {
}
} catch (InterruptedException e) {
ParWork.propegateInterrupt(e);
- throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, e);
+ throw new AlreadyClosedException(e);
} catch (ExecutionException e) {
// should be impossible... the problem with catching the exception
// at this level is we don't know what ShardRequest it applied to
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java
index ecb1c58..e33a5bd 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudBridgeTestCase.java
@@ -222,6 +222,8 @@ public abstract class SolrCloudBridgeTestCase extends SolrCloudTestCase {
public void cleanup() throws Exception {
if (cluster != null) cluster.shutdown();
if (controlCluster != null) controlCluster.shutdown();
+ cluster = null;
+ controlCluster = null;
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRequestForwarding.java b/solr/core/src/test/org/apache/solr/cloud/TestRequestForwarding.java
index 0efe9d8..793e182 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestRequestForwarding.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestRequestForwarding.java
@@ -46,6 +46,7 @@ public class TestRequestForwarding extends SolrTestCaseJ4 {
@Override
public void tearDown() throws Exception {
solrCluster.shutdown();
+ solrCluster = null;
System.clearProperty("solr.test.sys.prop1");
System.clearProperty("solr.test.sys.prop2");
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
index 7fb7980..bfdf31d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIDistributedZkTest.java
@@ -78,6 +78,7 @@ public class CollectionsAPIDistributedZkTest extends SolrCloudTestCase {
@After
public void tearDownCluster() throws Exception {
cluster.shutdown();
+ cluster = null;
}
@Test
diff --git a/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java b/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java
index 92bdaa0..710c2d1 100644
--- a/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java
+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java
@@ -52,6 +52,7 @@ public class BasicAuthOnSingleNodeTest extends SolrCloudAuthTestCase {
@After
public void tearDown() throws Exception {
cluster.shutdown();
+ cluster = null;
super.tearDown();
}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/TemplateUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/TemplateUpdateProcessorTest.java
index 61c67db..4dcdbde 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/TemplateUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/TemplateUpdateProcessorTest.java
@@ -43,15 +43,15 @@ public class TemplateUpdateProcessorTest extends SolrCloudTestCase {
@BeforeClass
public static void setupCluster() throws Exception {
- configureCluster(5)
+ configureCluster(TEST_NIGHTLY ? 5 : 2)
.addConfig("conf1", configset("cloud-minimal"))
.configure();
}
@After
public void after() throws Exception {
- cluster.deleteAllCollections();
cluster.shutdown();
+ cluster = null;
}
@org.junit.Rule
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
index f578ffc..baf4704 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
@@ -115,18 +115,14 @@ public class SolrTestCase extends LuceneTestCase {
new TestWatcher() {
@Override
protected void failed(Throwable e, Description description) {
- System.out.println("TEST FAILED!");
failed = true;
}
@Override
protected void succeeded(Description description) {
- System.out.println("TEST Worked!");
}
});
-
-
public static final int DEFAULT_ZK_SESSION_TIMEOUT = 20000; // default socket connection timeout in ms
public static final int DEFAULT_CONNECTION_TIMEOUT = 10000; // default socket connection timeout in ms
public static final int DEFAULT_SOCKET_TIMEOUT_MILLIS = 15000;
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 bdce64d..3aeb698 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
@@ -57,6 +57,7 @@ import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.CloudSolrClient.Builder;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.request.ConfigSetAdminRequest;
+import org.apache.solr.common.AlreadyClosedException;
import org.apache.solr.common.ParWork;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
@@ -156,6 +157,7 @@ public class MiniSolrCloudCluster {
private final boolean trackJettyMetrics;
private final AtomicInteger nodeIds = new AtomicInteger();
+ private boolean isShutDown;
/**
@@ -653,7 +655,11 @@ public class MiniSolrCloudCluster {
/**
* Shut down the cluster, including all Solr nodes and ZooKeeper
*/
- public void shutdown() throws Exception {
+ public synchronized void shutdown() throws Exception {
+ if (this.isShutDown) {
+ throw new AlreadyClosedException("This MiniSolrCloudCluster has already been shutdown");
+ }
+ this.isShutDown = true;
if (zkServer.getZkClient().isConnected()) {
// try {
// log.info("creating cluster shutdown zk node");