Tests: work-around for LUCENE-6406.

This commit is contained in:
Adrien Grand 2015-04-07 16:56:52 +02:00
parent c2f9987a15
commit ca6f6d4283
1 changed files with 9 additions and 0 deletions

View File

@ -25,12 +25,15 @@ import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope.Scope;
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
import org.apache.lucene.util.TimeUnits;
import org.elasticsearch.test.junit.listeners.LoggingListener;
import org.elasticsearch.test.junit.listeners.ReproduceInfoPrinter;
import org.junit.AfterClass;
/**
@ -66,4 +69,10 @@ public abstract class ElasticsearchLuceneTestCase extends LuceneTestCase {
public static int scaledRandomIntBetween(int min, int max) {
return RandomizedTest.scaledRandomIntBetween(min, max);
}
@AfterClass
public static void clearDefaultQueryCache() {
// TODO: remove me when https://issues.apache.org/jira/browse/LUCENE-6406 is fixed
IndexSearcher.setDefaultQueryCache(null);
}
}