javanna commented on code in PR #12544:
URL: https://github.com/apache/lucene/pull/12544#discussion_r1319723656


##########
lucene/core/src/test/org/apache/lucene/search/TestSort.java:
##########
@@ -849,11 +849,10 @@ public void testMultiSort() throws IOException {
   }
 
   public void testRewrite() throws IOException {
-    try (Directory dir = newDirectory()) {
-      RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
-      IndexSearcher searcher = newSearcher(writer.getReader());
-      writer.close();
-
+    try (Directory dir = newDirectory();
+        RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
+        DirectoryReader reader = writer.getReader()) {
+      IndexSearcher searcher = newSearcher(reader);

Review Comment:
   I am not too sure, I caught this by creating an executor at all times. Then 
all tests that use newSearcher and have a cache reader helper need their reader 
closed.



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to