Refresh the tracer with changed config properties now that we are using instances

This commit is contained in:
Luca Abbati 2019-06-05 15:38:00 +02:00
parent ae03abe63c
commit 057ca7b66e
No known key found for this signature in database
GPG Key ID: 74DBB952D9BA17F2
2 changed files with 6 additions and 3 deletions

View File

@ -64,12 +64,12 @@ public abstract class AgentTestRunner extends Specification {
*
* <p>Before the start of each test the reported traces will be reset.
*/
public static final ListWriter TEST_WRITER;
public static ListWriter TEST_WRITER;
// having a reference to io.opentracing.Tracer in test field
// loads opentracing before bootstrap classpath is setup
// so we declare tracer as an object and cast when needed.
protected static final Object TEST_TRACER;
protected static Object TEST_TRACER;
protected static final Set<String> TRANSFORMED_CLASSES = Sets.newConcurrentHashSet();
private static final AtomicInteger INSTRUMENTATION_ERROR_COUNT = new AtomicInteger();
@ -85,7 +85,10 @@ public abstract class AgentTestRunner extends Specification {
((Logger) LoggerFactory.getLogger("datadog")).setLevel(Level.DEBUG);
ConfigUtils.makeConfigInstanceModifiable();
refreshTestTracer();
}
public static void refreshTestTracer() {
TEST_WRITER =
new ListWriter() {
@Override

View File

@ -385,7 +385,7 @@ public class Config {
traceAnnotations = properties.getProperty(TRACE_ANNOTATIONS, parent.traceAnnotations);
traceMethods = properties.getProperty(TRACE_METHODS, parent.traceAnnotations);
traceMethods = properties.getProperty(TRACE_METHODS, parent.traceMethods);
traceExecutorsAll =
getPropertyBooleanValue(properties, TRACE_EXECUTORS_ALL, parent.traceExecutorsAll);