make test less evil: don't use random codec, even for the last IndexWriter

This commit is contained in:
Mike McCandless 2016-09-16 09:54:17 -04:00
parent 5d6b7fffc3
commit 9c6d34858e
1 changed files with 6 additions and 3 deletions

View File

@ -176,9 +176,12 @@ public class TestBoolean2 extends LuceneTestCase {
mulFactor *= 2; mulFactor *= 2;
} while(docCount < 3000 * NUM_FILLER_DOCS); } while(docCount < 3000 * NUM_FILLER_DOCS);
RandomIndexWriter w = new RandomIndexWriter(random(), dir2, iwc = newIndexWriterConfig(new MockAnalyzer(random()));
newIndexWriterConfig(new MockAnalyzer(random())) iwc.setMaxBufferedDocs(TestUtil.nextInt(random(), 50, 1000));
.setMaxBufferedDocs(TestUtil.nextInt(random(), 50, 1000))); // randomized codecs are sometimes too costly for this test:
iwc.setCodec(Codec.forName("Lucene62"));
RandomIndexWriter w = new RandomIndexWriter(random(), dir2, iwc);
doc = new Document(); doc = new Document();
doc.add(new Field("field2", "xxx", ft)); doc.add(new Field("field2", "xxx", ft));
for(int i=0;i<NUM_EXTRA_DOCS/2;i++) { for(int i=0;i<NUM_EXTRA_DOCS/2;i++) {