mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 13:43:03 +08:00
Potential fix for flaky celery test (#629)
It seems the same in memory span exporter was being reused by multiple tests. This change _should_ create a new instance of memeory exporter per test/function. Fixes #2067
This commit is contained in:
@ -70,7 +70,7 @@ def instrument(tracer_provider, memory_exporter):
|
||||
CeleryInstrumentor().uninstrument()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="function")
|
||||
def tracer_provider(memory_exporter):
|
||||
original_tracer_provider = trace_api.get_tracer_provider()
|
||||
|
||||
@ -86,7 +86,7 @@ def tracer_provider(memory_exporter):
|
||||
trace_api.set_tracer_provider(original_tracer_provider)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="function")
|
||||
def memory_exporter():
|
||||
memory_exporter = InMemorySpanExporter()
|
||||
return memory_exporter
|
||||
|
Reference in New Issue
Block a user