Closed natehart closed 6 years ago
@yurishkuro I made a minor change to the MockTracer to work with the type assumptions baked into the tests. Not only does this allow the tests to propagate MockSpans as expected, but it brings the Propagator constructor closer into line with the no-argument constructor's default values. You may want to put eyes on it before I merge in case I changed a very intentional design decision.
@yurishkuro I've done some digging into why code coverage is dropping so drastically, but I can't figure out where the problem is. I bet there is some null check in a test somewhere that was assuming a null return, but I'll be darned if I can figure out where it is. Unfortunately, I don't have any more time to spend on this. Merge it if you think it's worthwhile, otherwise you can close the PR.
In special circumstances, code may automatically generate spans, negating the need to always check if
Tracer.activeSpan()
isnull
. Under these circumstances, the Noop Tracer and ScopeManager will cause NPEs when they returnnull
values when theiractive
methods are accessed via the GlobalTracer. This prevents code from running successfully when using Noop Tracers.This minor change allows users to depend that their code will genuinely Noop under all use cases.
Signed-off-by: Nate Hart nhart@tableau.com