From ffbaa58de0322fff3946cdd4b6893dacc2a199ad Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Tue, 23 Apr 2013 19:44:52 +0000 Subject: [PATCH] SOLR-4753: add assert so that tests fail when SolrCores are closed too many times git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1471114 13f79535-47bb-0310-9956-ffa450edef68 --- solr/core/src/java/org/apache/solr/core/SolrCore.java | 1 + solr/core/src/test/org/apache/solr/core/TestLazyCores.java | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index 39c1ea86975..3e59c7f4c49 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -963,6 +963,7 @@ public final class SolrCore implements SolrInfoMBean { if (count > 0) return; // close is called often, and only actually closes if nothing is using it. if (count < 0) { log.error("Too many close [count:{}] on {}. Please report this exception to solr-user@lucene.apache.org", count, this ); + assert false : "Too many closes on SolrCore"; return; } log.info(logid+" CLOSING SolrCore " + this); diff --git a/solr/core/src/test/org/apache/solr/core/TestLazyCores.java b/solr/core/src/test/org/apache/solr/core/TestLazyCores.java index 46f63d06c04..7c17bf7ff0f 100644 --- a/solr/core/src/test/org/apache/solr/core/TestLazyCores.java +++ b/solr/core/src/test/org/apache/solr/core/TestLazyCores.java @@ -390,10 +390,6 @@ public class TestLazyCores extends SolrTestCaseJ4 { "/solr/cores/core[@name='core3']", "/solr/cores/core[@name='core4']"); assertXmlFile(oneXml, "13=count(/solr/cores/core)"); - core1.close(); - core2.close(); - core3.close(); - core4.close(); removeOne(cc, "collectionLazy2"); removeOne(cc, "collectionLazy3");