[TEST] also close wrapped readers

This commit is contained in:
Simon Willnauer 2015-05-05 20:45:49 +02:00
parent 11394983d9
commit 0b256cc629
1 changed files with 3 additions and 1 deletions

View File

@ -105,6 +105,7 @@ public class IndexCacheableQueryTests extends ElasticsearchTestCase {
IndexReader reader = writer.getReader();
IndexSearcher searcher = newSearcher(reader);
reader = searcher.getIndexReader(); // reader might be wrapped
searcher.setQueryCache(cache);
searcher.setQueryCachingPolicy(policy);
@ -118,8 +119,9 @@ public class IndexCacheableQueryTests extends ElasticsearchTestCase {
writer.addDocument(new Document());
DirectoryReader reader2 = writer.getReader();
IndexReader reader2 = writer.getReader();
searcher = newSearcher(reader2);
reader2 = searcher.getIndexReader(); // reader might be wrapped
searcher.setQueryCache(cache);
searcher.setQueryCachingPolicy(policy);