You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by bbarani <bb...@gmail.com> on 2013/05/16 18:46:41 UTC

SOLR test framework- ERROR: SolrIndexSearcher opens=1 closes=0

I am using SOLR 4.3.0, I have created multiple custom components.

I am getting the below error when I run tests (using SOLR 4.3 test
framework) against one of the custom component....All the tests pass but I
still get the below error once test gets completed. Can someone help me
resolve this error?

java.lang.AssertionError: ERROR: SolrIndexSearcher opens=1 closes=0
	at __randomizedtesting.SeedInfo.seed([C2DCAC50C9ACBACE]:0)
	at org.junit.Assert.fail(Assert.java:93)
	at
org.apache.solr.SolrTestCaseJ4.endTrackingSearchers(SolrTestCaseJ4.java:252)
	at org.apache.solr.SolrTestCaseJ4.afterClass(SolrTestCaseJ4.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1559)
	at
com.carrotsearch.randomizedtesting.RandomizedRunner.access$600(RandomizedRunner.java:79)
	at
com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:700)
	at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at
com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:53)
	at
org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:46)
	at
org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:42)
	at
com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:55)
	at
com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39)
	at
com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39)
	at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:43)
	at
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
	at
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70)
	at
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
	at
com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at
com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:358)
	at java.lang.Thread.run(Thread.java:680)





--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-test-framework-ERROR-SolrIndexSearcher-opens-1-closes-0-tp4063940.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLR test framework- ERROR: SolrIndexSearcher opens=1 closes=0

Posted by bbarani <bb...@gmail.com>.
Thanks a lot for your response.

I figured out that I am not closing the LocalSolrQueryRequest after handling
the response..The error got resolved after closing the request object.



--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-test-framework-ERROR-SolrIndexSearcher-opens-1-closes-0-tp4063940p4064044.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLR test framework- ERROR: SolrIndexSearcher opens=1 closes=0

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/16/2013 10:46 AM, bbarani wrote:
> I am using SOLR 4.3.0, I have created multiple custom components.
>
> I am getting the below error when I run tests (using SOLR 4.3 test
> framework) against one of the custom component....All the tests pass but I
> still get the below error once test gets completed. Can someone help me
> resolve this error?
>
> java.lang.AssertionError: ERROR: SolrIndexSearcher opens=1 closes=0

It looks like you opened a searcher object as part of your test but then 
didn't close it.  If you didn't do this in the test itself, perhaps it's 
happening in your custom component.

I'm a little fuzzy on test writing, though.

Thanks.
Shawn