mirror of https://github.com/apache/lucene.git
SOLR-12728: RequestLoggingTest fails on occasion, not reproducible
This commit is contained in:
parent
b4f9042a43
commit
74b53b1a67
|
@ -298,6 +298,8 @@ Bug Fixes
|
||||||
* SOLR-12704: Guard AddSchemaFieldsUpdateProcessorFactory against null field names and field values.
|
* SOLR-12704: Guard AddSchemaFieldsUpdateProcessorFactory against null field names and field values.
|
||||||
(Steve Rowe, Varun Thacker)
|
(Steve Rowe, Varun Thacker)
|
||||||
|
|
||||||
|
* SOLR-12728: RequestLoggingTest fails on occasion, not reproducible (Erick Erickson)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,23 @@ public class RequestLoggingTest extends SolrTestCaseJ4 {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
assertQ(req("q", "*:*"));
|
assertQ(req("q", "*:*"));
|
||||||
|
Matcher matcher = null;
|
||||||
String output = writer.toString();
|
boolean foundDebugMsg = false;
|
||||||
Matcher matcher = Pattern.compile("DEBUG.*q=\\*:\\*.*").matcher(output);
|
String output = "";
|
||||||
assertTrue(matcher.find());
|
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 group = matcher.group();
|
||||||
final String msg = "Should not have post query information";
|
final String msg = "Should not have post query information";
|
||||||
assertFalse(msg, group.contains("hits"));
|
assertFalse(msg, group.contains("hits"));
|
||||||
|
|
|
@ -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.
|
// Loop to give the logger time to process the async message and notify the new watcher.
|
||||||
boolean foundMsg = false;
|
boolean foundMsg = false;
|
||||||
long last = -1;
|
|
||||||
// In local testing this loop usually succeeds 1-2 tries.
|
// In local testing this loop usually succeeds 1-2 tries.
|
||||||
for (int msgIdx = 0; msgIdx < 100; ++msgIdx) {
|
for (int msgIdx = 0; msgIdx < 100; ++msgIdx) {
|
||||||
// Returns an empty (but non-null) list even if there are no messages yet.
|
// Returns an empty (but non-null) list even if there are no messages yet.
|
||||||
|
|
Loading…
Reference in New Issue