Skip to content

Apache Lucene open-source search software

Don't print seed notes on assumption errors.

Dawid Weiss0e3af8045296
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java b/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
index aaf1f66b951..c9ba8037097 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
@@ -23,6 +23,7 @@ import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.List;
+import org.junit.internal.AssumptionViolatedException;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.MultipleFailureException;
@@ -85,7 +86,7 @@ public class UncaughtExceptionsRule implements TestRule {
uncaughtExceptions.clear();
}
- if (!errors.isEmpty()) {
+ if (hasNonAssumptionErrors(errors)) {
if (ltc == null) {
// class level failure (e.g. afterclass)
LuceneTestCase.reportPartialFailureInfo();
@@ -98,7 +99,16 @@ public class UncaughtExceptionsRule implements TestRule {
}
};
}
-
+
+ private boolean hasNonAssumptionErrors(ArrayList<Throwable> errors) {
+ for (Throwable t : errors) {
+ if (!(t instanceof AssumptionViolatedException)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Just a check if anything's been caught.
*/