You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/08/23 11:15:42 UTC

lucene-solr:master: SOLR-11281: Improve failure message.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 1a614058e -> 946c6a95f


SOLR-11281: Improve failure message.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/946c6a95
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/946c6a95
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/946c6a95

Branch: refs/heads/master
Commit: 946c6a95faa61902e6fffdb54373c04135c68ad9
Parents: 1a61405
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Wed Aug 23 13:14:40 2017 +0200
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Wed Aug 23 13:15:36 2017 +0200

----------------------------------------------------------------------
 .../apache/solr/metrics/reporters/SolrSlf4jReporterTest.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/946c6a95/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
index 37bb940..137872a 100644
--- a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrSlf4jReporterTest.java
@@ -81,7 +81,11 @@ public class SolrSlf4jReporterTest extends SolrTestCaseJ4 {
     SolrDocumentList history = watcher.getHistory(-1, null);
     // dot-separated names are treated like class names and collapsed
     // in regular log output, but here we get the full name
-    assertTrue(history.stream().filter(d -> "solr.node".equals(d.getFirstValue("logger"))).count() > 0);
-    assertTrue(history.stream().filter(d -> "foobar".equals(d.getFirstValue("logger"))).count() > 0);
+    if (history.stream().filter(d -> "solr.node".equals(d.getFirstValue("logger"))).count() == 0) {
+      fail("No 'solr.node' logs in: " + history.toString());
+    }
+    if (history.stream().filter(d -> "foobar".equals(d.getFirstValue("logger"))).count() == 0) {
+      fail("No 'foobar' logs in: " + history.toString());
+    }
   }
 }