You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2018/09/03 17:24:15 UTC
lucene-solr:branch_7x: SOLR-12728: RequestLoggingTest fails on
occasion, not reproducible
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 1ff9cbf4d -> d3e6fb5bf
SOLR-12728: RequestLoggingTest fails on occasion, not reproducible
(cherry picked from commit 74b53b1a6756f106ec281dc6ef9bc52f7d989384)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d3e6fb5b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d3e6fb5b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d3e6fb5b
Branch: refs/heads/branch_7x
Commit: d3e6fb5bff5affab449b4be347e587d02134a9d5
Parents: 1ff9cbf
Author: Erick Erickson <Er...@gmail.com>
Authored: Mon Sep 3 10:19:33 2018 -0700
Committer: Erick Erickson <Er...@gmail.com>
Committed: Mon Sep 3 10:20:02 2018 -0700
----------------------------------------------------------------------
solr/CHANGES.txt | 2 ++
.../apache/solr/handler/RequestLoggingTest.java | 21 ++++++++++++++++----
.../org/apache/solr/logging/TestLogWatcher.java | 1 -
3 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d3e6fb5b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f2e29f3..0cdc9c3 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -243,6 +243,8 @@ Bug Fixes
* SOLR-12704: Guard AddSchemaFieldsUpdateProcessorFactory against null field names and field values.
(Steve Rowe, Varun Thacker)
+* SOLR-12728: RequestLoggingTest fails on occasion, not reproducible (Erick Erickson)
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d3e6fb5b/solr/core/src/test/org/apache/solr/handler/RequestLoggingTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/RequestLoggingTest.java b/solr/core/src/test/org/apache/solr/handler/RequestLoggingTest.java
index 0e8a7a9..ae08e9a 100644
--- a/solr/core/src/test/org/apache/solr/handler/RequestLoggingTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/RequestLoggingTest.java
@@ -82,10 +82,23 @@ public class RequestLoggingTest extends SolrTestCaseJ4 {
try {
assertQ(req("q", "*:*"));
-
- String output = writer.toString();
- Matcher matcher = Pattern.compile("DEBUG.*q=\\*:\\*.*").matcher(output);
- assertTrue(matcher.find());
+ Matcher matcher = null;
+ boolean foundDebugMsg = false;
+ String output = "";
+ for (int msgIdx = 0; msgIdx < 100; ++msgIdx) {
+ output = writer.toString();
+ matcher = Pattern.compile("DEBUG.*q=\\*:\\*.*").matcher(output);
+ if (matcher.find()) {
+ foundDebugMsg = true;
+ break;
+ }
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException ie) {
+ ;
+ }
+ }
+ assertTrue("Should have found debug-level message. Found " + output, foundDebugMsg);
final String group = matcher.group();
final String msg = "Should not have post query information";
assertFalse(msg, group.contains("hits"));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d3e6fb5b/solr/core/src/test/org/apache/solr/logging/TestLogWatcher.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/logging/TestLogWatcher.java b/solr/core/src/test/org/apache/solr/logging/TestLogWatcher.java
index 9548363..658bc34 100644
--- a/solr/core/src/test/org/apache/solr/logging/TestLogWatcher.java
+++ b/solr/core/src/test/org/apache/solr/logging/TestLogWatcher.java
@@ -53,7 +53,6 @@ public class TestLogWatcher extends SolrTestCaseJ4 {
// Loop to give the logger time to process the async message and notify the new watcher.
boolean foundMsg = false;
- long last = -1;
// In local testing this loop usually succeeds 1-2 tries.
for (int msgIdx = 0; msgIdx < 100; ++msgIdx) {
// Returns an empty (but non-null) list even if there are no messages yet.