LUCENE-10291: Don't use CFS in testMinimalCodec (#593)

This test was occasionally failing on CI, as the test randomly installed a merge policy
that would force compound file creation while the goal of the test was not to do so.
This commit is contained in:
Yannick Welsch 2022-01-10 13:17:45 +01:00 committed by GitHub
parent 42fe2d5620
commit d9d65ab849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,8 @@ public class TestMinimalCodec extends LuceneTestCase {
.setCodec(useCompoundFile ? new MinimalCompoundCodec() : new MinimalCodec())
.setUseCompoundFile(useCompoundFile);
if (!useCompoundFile) {
// Avoid using MockMP as it randomly enables compound file creation
writerConfig.setMergePolicy(newMergePolicy(random(), false));
writerConfig.getMergePolicy().setNoCFSRatio(0.0);
writerConfig.getMergePolicy().setMaxCFSSegmentSizeMB(Double.POSITIVE_INFINITY);
}