LUCENE-6096: Avoid CMS which can close segments while we are measuring ram usage of the filter cache.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1644673 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2014-12-11 15:17:56 +00:00
parent b7a20caf84
commit 135818c0c2
1 changed files with 6 additions and 1 deletions

View File

@ -32,8 +32,10 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.SerialMergeScheduler;
import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Bits;
@ -306,7 +308,10 @@ public class TestLRUFilterCache extends LuceneTestCase {
};
Directory dir = newDirectory();
final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
// serial merges so that segments do not get closed while we are measuring ram usage
// with RamUsageTester
IndexWriterConfig iwc = newIndexWriterConfig().setMergeScheduler(new SerialMergeScheduler());
final RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
final List<String> colors = Arrays.asList("blue", "red", "green", "yellow");