dnhatn commented on code in PR #15723:
URL: https://github.com/apache/lucene/pull/15723#discussion_r2829464669


##########
lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java:
##########
@@ -1603,6 +1608,194 @@ public void testReaderNotSuitedForCaching() throws 
IOException {
     dir.close();
   }
 
+  public void testSkipCacheIfOngoing() throws Exception {
+    Directory dir = newDirectory();
+    IndexWriterConfig iwc = new IndexWriterConfig();
+    IndexWriter w = new IndexWriter(dir, iwc);
+    int numThreads = RandomNumbers.randomIntBetween(random(), 2, 6);
+    int numDocs = numThreads * 100;
+    for (int i = 0; i < numDocs; i++) {
+      var doc = new Document();
+      doc.add(new StringField("doc", Integer.toString(i), Store.NO));
+      w.addDocument(doc);
+    }
+    DirectoryReader reader = DirectoryReader.open(w);
+    assertThat(reader.leaves(), hasSize(1));
+    LeafReaderContext singleLeaf = reader.leaves().get(0);
+
+    AtomicInteger visited = new AtomicInteger(0);

Review Comment:
   ++ added in 
https://github.com/apache/lucene/pull/15723/commits/4f80ab0108c5ed396ffcd2c615c210a79cd8b1b0



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to