avoid NRTCachingDirectory in this test

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1481938 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-05-13 15:45:31 +00:00
parent c819b8a753
commit d9c6fa0b49
1 changed files with 4 additions and 1 deletions

View File

@ -53,6 +53,7 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MMapDirectory;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.MockDirectoryWrapper.Throttling; import org.apache.lucene.store.MockDirectoryWrapper.Throttling;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -594,7 +595,9 @@ public abstract class BaseStoredFieldsFormatTestCase extends LuceneTestCase {
public void testBigDocuments() throws IOException { public void testBigDocuments() throws IOException {
// "big" as "much bigger than the chunk size" // "big" as "much bigger than the chunk size"
// for this test we force a FS dir // for this test we force a FS dir
Directory dir = newFSDirectory(_TestUtil.getTempDir(getClass().getSimpleName())); // we can't just use newFSDirectory, because this test doesn't really index anything.
// so if we get NRTCachingDir+SimpleText, we make massive stored fields and OOM (LUCENE-4484)
Directory dir = new MockDirectoryWrapper(random(), new MMapDirectory(_TestUtil.getTempDir("testBigDocuments")));
IndexWriterConfig iwConf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())); IndexWriterConfig iwConf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
iwConf.setMaxBufferedDocs(RandomInts.randomIntBetween(random(), 2, 30)); iwConf.setMaxBufferedDocs(RandomInts.randomIntBetween(random(), 2, 30));
RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConf); RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConf);