Skip to content

Commit

Permalink
Store ScopeShim in context
Browse files Browse the repository at this point in the history
This uses the OpenTelemetry context management mechanism to store a
ScopeShim object in order to make active return the same object as the
one returned by start_active_span.

WIP: there is one failing test case, apparently the context does not get
cleared before running every test case. This seems related to the order
in which test cases are being run.
  • Loading branch information
ocelotl committed Jul 21, 2020
1 parent 812e4bc commit 98a16a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/opentelemetry-ext-opentracing-shim/tests/test_shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ def test_extract_empty_context_returns_invalid_context(self):
try:
carrier = {}

from ipdb import set_trace
set_trace()
ctx = self.shim.extract(opentracing.Format.HTTP_HEADERS, carrier)
self.assertEqual(ctx.unwrap(), trace.INVALID_SPAN_CONTEXT)
finally:
Expand Down

0 comments on commit 98a16a0

Please sign in to comment.