Less flakey tests

This commit is contained in:
Marcin Grzejszczak
2018-01-19 23:07:43 +01:00
parent 7eb374b5a5
commit 1bb544ed4b
2 changed files with 4 additions and 2 deletions

View File

@@ -100,7 +100,7 @@ public class TraceCallableTests {
return new Callable<Span>() {
@Override
public Span call() throws Exception {
return Tracing.currentTracer().currentSpan();
return tracer.currentSpan();
}
@Override

View File

@@ -5,6 +5,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicReference;
import brave.Span;
import brave.Tracer;
import brave.Tracing;
import brave.propagation.CurrentTraceContext;
import org.junit.After;
@@ -27,6 +28,7 @@ public class TraceRunnableTests {
.currentTraceContext(CurrentTraceContext.Default.create())
.spanReporter(this.reporter)
.build();
Tracer tracer = this.tracing.tracer();
@After
public void clean() {
@@ -118,7 +120,7 @@ public class TraceRunnableTests {
return new Runnable() {
@Override
public void run() {
span.set(Tracing.currentTracer().currentSpan());
span.set(tracer.currentSpan());
}
@Override public String toString() {