Tests: Disable random wrapping of index readers in IndexCacheableQueryTests until LUCENE-6500 is fixed.

This commit is contained in:
Adrien Grand 2015-05-31 11:08:06 +02:00
parent 1a6613b337
commit a70fd88d62
1 changed files with 9 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Weight; import org.apache.lucene.search.Weight;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
import org.apache.lucene.util.Version;
import org.elasticsearch.test.ElasticsearchTestCase; import org.elasticsearch.test.ElasticsearchTestCase;
import java.io.IOException; import java.io.IOException;
@ -103,7 +104,10 @@ public class IndexCacheableQueryTests extends ElasticsearchTestCase {
} }
IndexReader reader = writer.getReader(); IndexReader reader = writer.getReader();
IndexSearcher searcher = newSearcher(reader); // IndexReader wrapping is disabled because of LUCENE-6500.
// Add it back when we are on 5.3
assert Version.LATEST == Version.LUCENE_5_2_0;
IndexSearcher searcher = newSearcher(reader, false);
reader = searcher.getIndexReader(); // reader might be wrapped reader = searcher.getIndexReader(); // reader might be wrapped
searcher.setQueryCache(cache); searcher.setQueryCache(cache);
searcher.setQueryCachingPolicy(policy); searcher.setQueryCachingPolicy(policy);
@ -119,7 +123,10 @@ public class IndexCacheableQueryTests extends ElasticsearchTestCase {
writer.addDocument(new Document()); writer.addDocument(new Document());
IndexReader reader2 = writer.getReader(); IndexReader reader2 = writer.getReader();
searcher = newSearcher(reader2); // IndexReader wrapping is disabled because of LUCENE-6500.
// Add it back when we are on 5.3
assert Version.LATEST == Version.LUCENE_5_2_0;
searcher = newSearcher(reader2, false);
reader2 = searcher.getIndexReader(); // reader might be wrapped reader2 = searcher.getIndexReader(); // reader might be wrapped
searcher.setQueryCache(cache); searcher.setQueryCache(cache);
searcher.setQueryCachingPolicy(policy); searcher.setQueryCachingPolicy(policy);