Skip to content

Commit

Permalink
Potential fix for flaky celery test (#629)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
owais authored Aug 25, 2021
1 parent bfaabbf commit c6976fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/opentelemetry-docker-tests/tests/celery/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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

0 comments on commit c6976fc

Please sign in to comment.