pulls change back from master

This commit is contained in:
Adrian Cole
2020-04-04 09:49:36 +08:00
parent c20f6c6a11
commit a497befa56
3 changed files with 16 additions and 9 deletions

View File

@@ -82,12 +82,15 @@ public abstract class ReactorSleuth {
}
if (!springContext.isActive()) {
if (log.isTraceEnabled()) {
log.trace("Spring Context [" + springContext
boolean assertOn = false;
assert assertOn = true; // gives a message in unit test failures
if (log.isTraceEnabled() || assertOn) {
String message = "Spring Context [" + springContext
+ "] is not yet refreshed. This is unexpected. Reactor Context is ["
+ sub.currentContext() + "] and name is [" + name(sub) + "]");
+ sub.currentContext() + "] and name is [" + name(sub) + "]";
log.trace(message);
assert false : message; // should never happen, but don't break.
}
assert false; // should never happen, but don't break.
return sub;
}
@@ -101,12 +104,15 @@ public abstract class ReactorSleuth {
// Try to get the current trace context bean, lenient when there are problems
CurrentTraceContext currentTraceContext = lazyCurrentTraceContext.get();
if (currentTraceContext == null) {
if (log.isTraceEnabled()) {
log.trace("Spring Context [" + springContext
boolean assertOn = false;
assert assertOn = true; // gives a message in unit test failures
if (log.isTraceEnabled() || assertOn) {
String message = "Spring Context [" + springContext
+ "] did not return a CurrentTraceContext. Reactor Context is ["
+ sub.currentContext() + "] and name is [" + name(sub) + "]");
+ sub.currentContext() + "] and name is [" + name(sub) + "]";
log.trace(message);
assert false : message; // should never happen, but don't break.
}
assert false; // should never happen, but don't break.
return sub;
}

View File

@@ -177,7 +177,7 @@ public class Slf4JSpanLoggerTest {
.asInstanceOf(InstanceOfAssertFactories.array(CorrelationField[].class))
.extracting(CorrelationField::name).containsExactly("traceId", "parentId",
"spanId", "spanExportable", "my-baggage", "my-local",
"my-propagation"); // my-baggage-two is baggage not in the whitelist
"my-propagation"); // my-baggage-two is not in the whitelist
}
@Test

View File

@@ -4,6 +4,7 @@
"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files=".*/test/.*" checks="JavadocVariable"/>
<suppress files=".*ReactorSleuth\.java" checks="InnerAssignment"/>
<suppress files=".*FinishedSpanHandlerTests.*" checks="LineLengthCheck"/>
<suppress files=".*GrpcTracingIntegrationTests.*" checks="LineLengthCheck"/>
<suppress files=".*IgnoreAutoConfiguredSkipPatternsIntegrationTests.*" checks="LineLengthCheck"/>