Hi,

I think I've found the cause:

src/java/org/apache/solr/util/TestHarness.java,  query(String handler,
SolrQueryRequest req) calls SolrRequestInfo.setRequestInfo(new
SolrRequestInfo(req, rsp)), which my componenet also calls in the same
thread hence the error.

The fix was to override assertQ to call
queryAndResponse(String handler, SolrQueryRequest req) instead which
does not set/clear SolrRequestInfo

Regards,
Dan

On Mon, Jan 31, 2011 at 2:32 PM, dan sutton <danbsut...@gmail.com> wrote:
> Hi,
>
> I have 2 cores CoreA and CoreB, when updating content on CoreB, I use
> solrj and EmbeddedSolrServer to query CoreA for information, however
> when I do this with my junit tests (which also use EmbeddedSolrServer
> to query) I get this error
>
> SEVERE: Previous SolrRequestInfo was not closed!
>
> junit.framework.AssertionFailedError
> [junit]     at 
> org.apache.solr.request.SolrRequestInfo.setRequestInfo(SolrRequestInfo.java:45)
>
> How should I write the junit tests to test a multi-core, with
> EmbeddedSolrServer used in a component during querying?
>
> Cheers,
> Dan
>

Reply via email to