Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-3161: ignore expected exceptions

Yonik Seeley859814a06f76
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
index aabd9c1dd03..8c5e56f29a8 100755
--- a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
@@ -292,11 +292,13 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
//SOLR 3161 ensure shards.qt=/update fails (anything but search handler really)
// Also see TestRemoteStreaming#testQtUpdateFails()
try {
+ ignoreException("isShard is only acceptable");
query("q","*:*","shards.qt","/update","stream.body","<delete><query>*:*</query></delete>");
fail();
} catch (SolrException e) {
//expected
}
+ unIgnoreException("isShard is only acceptable");
// test debugging
handle.put("explain", UNORDERED);
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index f8577d9f526..bfe9e23d1ed 100755
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -235,6 +235,12 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
SolrException.ignorePatterns.add(pattern);
}
+ public static void unIgnoreException(String pattern) {
+ if (SolrException.ignorePatterns != null)
+ SolrException.ignorePatterns.remove(pattern);
+ }
+
+
public static void resetExceptionIgnores() {
SolrException.ignorePatterns = null;
ignoreException("ignore_exception"); // always ignore "ignore_exception"
diff --git a/solr/testlogging.properties b/solr/testlogging.properties
index b27b089a1f8..a1b7cafa257 100644
--- a/solr/testlogging.properties
+++ b/solr/testlogging.properties
@@ -1,7 +1,14 @@
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=FINEST
-java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
+#java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
+java.util.logging.ConsoleHandler.formatter=org.apache.solr.SolrLogFormatter
+
.level=SEVERE
-#org.apache.solr.update.UpdateLog.level=FINEST
+#.level=INFO
+
+#org.apache.solr.update.processor.LogUpdateProcessor=FINEST
+#org.apache.solr.update.processor.DistributedUpdateProcessor=FINEST
+#org.apache.solr.update.PeerSync.level=FINEST
+#org.apache.solr.update.UpdateLog.level=FINE
#org.apache.solr.update.TransactionLog.level=FINEST