You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2022/11/22 14:09:19 UTC

[lucene] branch main updated (369a70f2894 -> ad04ac1bc44)

This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


    from 369a70f2894 Support deletions in rearrange (#11815)
     new 521c0e24f2d #10878: revert #02528c6757d10420cc7d545282b49c4322943ac7 (add some test verbosity on failure (#11935))
     new acbc08fb326 expand wildcard imports
     new 4bd4f8b5218 remove unused imports
     new ad04ac1bc44 tidy up

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/lucene/index/TestIndexFileDeleter.java  | 23 +++-------------------
 1 file changed, 3 insertions(+), 20 deletions(-)


[lucene] 03/04: remove unused imports

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 4bd4f8b5218b43e4f6eede124b1821bdf526f585
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Tue Nov 22 08:18:41 2022 -0500

    remove unused imports
---
 lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index c1be9bf889e..cef33333dc6 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -16,9 +16,7 @@
  */
 package org.apache.lucene.index;
 
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.PrintStream;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;


[lucene] 01/04: #10878: revert #02528c6757d10420cc7d545282b49c4322943ac7 (add some test verbosity on failure (#11935))

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 521c0e24f2d3f7137b2cab8dc99e9f5dace04a9d
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Tue Nov 22 07:59:08 2022 -0500

    #10878: revert #02528c6757d10420cc7d545282b49c4322943ac7 (add some test verbosity on failure (#11935))
---
 .../apache/lucene/index/TestIndexFileDeleter.java  | 33 ++++------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index c10fc32c5c9..01cdbbe0c17 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -16,17 +16,9 @@
  */
 package org.apache.lucene.index;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
+import java.io.*;
 import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
 import org.apache.lucene.document.Document;
@@ -42,7 +34,6 @@ import org.apache.lucene.tests.index.RandomIndexWriter;
 import org.apache.lucene.tests.store.MockDirectoryWrapper;
 import org.apache.lucene.tests.util.LuceneTestCase;
 import org.apache.lucene.tests.util.TestUtil;
-import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.InfoStream;
 
 /*
@@ -439,19 +430,13 @@ public class TestIndexFileDeleter extends LuceneTestCase {
 
     final AtomicBoolean doFailExc = new AtomicBoolean();
 
-    final ByteArrayOutputStream bytesLog = new ByteArrayOutputStream();
-    final PrintStream log = new PrintStream(bytesLog, true, IOUtils.UTF_8);
-
     dir.failOn(
         new MockDirectoryWrapper.Failure() {
           @Override
           public void eval(MockDirectoryWrapper dir) throws IOException {
             if (doFailExc.get() && random().nextInt(4) == 1) {
               if (callStackContains(IndexFileDeleter.class, "decRef")) {
-                RuntimeException re = new RuntimeException("fake fail");
-                log.println("Now throw fake exception:");
-                re.printStackTrace(log);
-                throw re;
+                throw new RuntimeException("fake fail");
               }
             }
           }
@@ -468,15 +453,11 @@ public class TestIndexFileDeleter extends LuceneTestCase {
               // suppress only FakeIOException:
               if (exc instanceof RuntimeException && exc.getMessage().equals("fake fail")) {
                 // ok to ignore
-                log.println("Ignoring \"ok\" exception:");
-                exc.printStackTrace(log);
               } else if ((exc instanceof AlreadyClosedException
                       || exc instanceof IllegalStateException)
                   && exc.getCause() != null
                   && "fake fail".equals(exc.getCause().getMessage())) {
                 // also ok to ignore
-                log.println("Ignoring \"ok\" exception:");
-                exc.printStackTrace(log);
               } else {
                 super.handleMergeException(exc);
               }
@@ -508,14 +489,10 @@ public class TestIndexFileDeleter extends LuceneTestCase {
           w.addDocument(doc);
         }
       } catch (Throwable t) {
-        if ((t.toString().contains("fake fail")
-            || (t.getCause() != null && t.getCause().toString().contains("fake fail")))) {
+        if (t.toString().contains("fake fail")
+            || (t.getCause() != null && t.getCause().toString().contains("fake fail"))) {
           // ok
-          log.println("Ignoring \"ok\" exception:");
-          t.printStackTrace(log);
         } else {
-          System.out.println("test failed!  full log:");
-          System.out.print(bytesLog.toString("UTF-8"));
           throw t;
         }
       }


[lucene] 02/04: expand wildcard imports

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit acbc08fb326323dbc600db89085a14d624e91d5a
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Tue Nov 22 08:03:54 2022 -0500

    expand wildcard imports
---
 .../test/org/apache/lucene/index/TestIndexFileDeleter.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index 01cdbbe0c17..c1be9bf889e 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -16,10 +16,19 @@
  */
 package org.apache.lucene.index;
 
-import java.io.*;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
 import java.nio.file.Path;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;


[lucene] 04/04: tidy up

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit ad04ac1bc443b4e09c78f88d79bcc3f50bb46a6f
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Tue Nov 22 08:20:30 2022 -0500

    tidy up
---
 lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index cef33333dc6..c92ad20fc78 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -26,7 +26,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
-
 import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;