GITHUB-11761 (part 2): Fix unit tests to cleany work with new TierMergePolicy delete pct default (#11841)

Co-authored-by: Marc D'Mello <dmellomd@amazon.com>
This commit is contained in:
Marc D'Mello 2022-10-13 06:18:50 -07:00 committed by GitHub
parent 83891d9a61
commit 3a608995a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -1341,11 +1341,12 @@ public class TestIndexWriterDelete extends LuceneTestCase {
w.addDocument(doc);
w.addDocument(doc);
w.addDocument(doc);
w.addDocument(doc);
w.addDocument(doc);
doc.add(new StringField("id", "1", Field.Store.YES));
w.addDocument(doc);
w.close();
iwc = new IndexWriterConfig(new MockAnalyzer(random()));
((TieredMergePolicy) iwc.getMergePolicy()).setDeletesPctAllowed(33.0);
iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND);
w = new IndexWriter(d, iwc);
IndexReader r = DirectoryReader.open(w, false, false);

View File

@ -310,9 +310,9 @@ public class TestTieredMergePolicy extends BaseMergePolicyTestCase {
((1024.0 * 1024.0)); // fudge it up, we're trying to catch egregious errors and segbytes
// don't really reflect the number for original merges.
tmp.setMaxMergedSegmentMB(mbSize);
tmp.setDeletesPctAllowed(33.0);
conf.setMaxBufferedDocs(100);
conf.setMergePolicy(tmp);
conf.setMergeScheduler(new SerialMergeScheduler());
final IndexWriter w = new IndexWriter(dir, conf);