kotman12 commented on code in PR #4310:
URL: https://github.com/apache/solr/pull/4310#discussion_r3119266886


##########
solr/core/src/test/org/apache/solr/update/SolrIndexFingerprintTest.java:
##########
@@ -38,13 +43,23 @@ public void testSequentialVsParallelFingerprint() throws 
Exception {
     SolrCore core = h.getCore();
 
     int numDocs = RANDOM_MULTIPLIER == 1 ? 3 : 500;
-    // Create a set of many segments (to catch race conditions, i.e. 
SOLR-17863)
-    IntStream.range(0, numDocs)
-        .forEach(
-            i -> {
-              assertU(adoc("id", "" + i));
-              assertU(commit());
-            });
+    // Create a set of many segments (to catch race conditions, i.e. 
SOLR-17863).
+    // Write directly to the IndexWriter and flush after each doc to create 
one segment per doc,
+    // avoiding the overhead of opening a new searcher on every Solr commit.
+    RefCounted<IndexWriter> iwRef = 
core.getSolrCoreState().getIndexWriter(core);
+    try {
+      IndexWriter writer = iwRef.get();
+      for (int i = 0; i < numDocs; i++) {

Review Comment:
   It respects it since we are still getting the IW from the core:
   
   <img width="585" height="252" alt="image" 
src="https://github.com/user-attachments/assets/ad1d2290-b598-41be-b6ea-e979e74fe849";
 />
   



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