atris commented on a change in pull request #1294: LUCENE-9074: Slice 
Allocation Control Plane For Concurrent Searches
URL: https://github.com/apache/lucene-solr/pull/1294#discussion_r401542281
 
 

 ##########
 File path: lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
 ##########
 @@ -70,13 +75,31 @@ public void setUp() throws Exception {
     }
     reader = iw.getReader();
     iw.close();
+
+    Random random = random();
+    RandomIndexWriter iw2 = new RandomIndexWriter(random(), dir2, 
newIndexWriterConfig().setMergePolicy(newLogMergePolicy()));
+    for (int i = 0; i < 100; i++) {
+      Document doc = new Document();
+      doc.add(newStringField("field", Integer.toString(i), Field.Store.NO));
+      doc.add(newStringField("field2", Boolean.toString(i % 2 == 0), 
Field.Store.NO));
+      doc.add(new SortedDocValuesField("field2", new 
BytesRef(Boolean.toString(i % 2 == 0))));
+      iw2.addDocument(doc);
+
+      if (random.nextBoolean()) {
+        iw2.commit();
+      }
+    }
+    reader2 = iw2.getReader();
+    iw2.close();
 
 Review comment:
   reader2 has random commits baked into it to ensure random slice 
distributions each time the test is run.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to