Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Latest commit

 

History

History
60 lines (39 loc) · 2.61 KB

README.md

File metadata and controls

60 lines (39 loc) · 2.61 KB

Testbed suite for the OpenTracing API

Testbed suite designed to test API changes.

Build and test.

make testbed

Depending on whether Python 2 or 3 is being used, the asyncio tests will be automatically disabled.

Alternatively, due to the organization of the suite, it's possible to run directly the tests using py.test:

    py.test -s testbed/test_multiple_callbacks/test_threads.py

Tested frameworks

Currently the examples cover threading, tornado, gevent, asyncio (which requires Python 3) and contextvars (which requires Python 3.7 and higher). Each example uses their respective ScopeManager instance from opentracing.scope_managers, along with their related requirements and limitations.

threading, asyncio and gevent

No automatic Span propagation between parent and children tasks is provided, and thus the Span need to be manually passed down the chain.

tornado

TornadoScopeManager uses a variation of tornado.stack_context.StackContext to both store and automatically propagate the context from parent coroutines to their children.

Currently, yielding over multiple children is not supported, as the context is effectively shared, and switching from coroutine to coroutine messes up the current active Span.

contextvars

ContextVarsScopeManager uses contextvars module to both store and automatically propagate the context from parent coroutines / tasks / scheduled in event loop callbacks to their children.

List of patterns

Adding new patterns

A new pattern is composed of a directory under testbed with the test_ prefix, and containing the files for each platform, also with the test_ prefix:

testbed/
  test_new_pattern/
    test_threads.py
    test_tornado.py
    test_asyncio.py
    test_gevent.py

Supporting all the platforms is optional, and a warning will be displayed when doing make testbed in such case.