mirror of https://github.com/apache/lucene.git
Fix intermittently failing TestParallelLeafReader (#12865)
This commit fixes the intermittently failing TestParallelLeafReader. The ParallelLeafReader requires the document order to be consistent across indexes - each document contains the union of the fields of all documents with the same document number. The test asserts this. But now, with MockRandomMergePolicy potentially reversing the doc ID order while merging, this invalidates the assumption of the test indexes and assertions. The solution is to just ensure that no merging actually happens in these tiny test indexes.
This commit is contained in:
parent
65d30ca1af
commit
e852dfe550
|
@ -301,7 +301,9 @@ public class TestParallelLeafReader extends LuceneTestCase {
|
|||
|
||||
private Directory getDir1(Random random) throws IOException {
|
||||
Directory dir1 = newDirectory();
|
||||
IndexWriter w1 = new IndexWriter(dir1, newIndexWriterConfig(new MockAnalyzer(random)));
|
||||
IndexWriterConfig conf =
|
||||
newIndexWriterConfig(new MockAnalyzer(random())).setMergePolicy(new LogDocMergePolicy());
|
||||
IndexWriter w1 = new IndexWriter(dir1, conf);
|
||||
Document d1 = new Document();
|
||||
d1.add(newTextField("f1", "v1", Field.Store.YES));
|
||||
d1.add(newTextField("f2", "v1", Field.Store.YES));
|
||||
|
@ -317,7 +319,9 @@ public class TestParallelLeafReader extends LuceneTestCase {
|
|||
|
||||
private Directory getDir2(Random random) throws IOException {
|
||||
Directory dir2 = newDirectory();
|
||||
IndexWriter w2 = new IndexWriter(dir2, newIndexWriterConfig(new MockAnalyzer(random)));
|
||||
IndexWriterConfig conf =
|
||||
newIndexWriterConfig(new MockAnalyzer(random())).setMergePolicy(new LogDocMergePolicy());
|
||||
IndexWriter w2 = new IndexWriter(dir2, conf);
|
||||
Document d3 = new Document();
|
||||
d3.add(newTextField("f3", "v1", Field.Store.YES));
|
||||
d3.add(newTextField("f4", "v1", Field.Store.YES));
|
||||
|
|
Loading…
Reference in New Issue