don't reset counts until after we are done retrying

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1236352 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2012-01-26 19:16:08 +00:00
parent f640687877
commit 5293942927
1 changed files with 4 additions and 4 deletions

View File

@ -124,9 +124,6 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
long endNumOpens = SolrIndexSearcher.numOpens.get();
long endNumCloses = SolrIndexSearcher.numCloses.get();
SolrIndexSearcher.numOpens.getAndSet(0);
SolrIndexSearcher.numCloses.getAndSet(0);
// wait a bit in case any ending threads have anything to release
int retries = 0;
while (endNumOpens - numOpens != endNumCloses - numCloses) {
@ -139,7 +136,10 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
endNumOpens = SolrIndexSearcher.numOpens.get();
endNumCloses = SolrIndexSearcher.numCloses.get();
}
SolrIndexSearcher.numOpens.getAndSet(0);
SolrIndexSearcher.numCloses.getAndSet(0);
if (endNumOpens-numOpens != endNumCloses-numCloses) {
String msg = "ERROR: SolrIndexSearcher opens=" + (endNumOpens-numOpens) + " closes=" + (endNumCloses-numCloses);
log.error(msg);