Skip to content

Commit c6976fc

Browse files
authored
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
1 parent bfaabbf commit c6976fc

File tree

1 file changed

+2
-2
lines changed
  • tests/opentelemetry-docker-tests/tests/celery

1 file changed

+2
-2
lines changed

tests/opentelemetry-docker-tests/tests/celery/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def instrument(tracer_provider, memory_exporter):
7070
CeleryInstrumentor().uninstrument()
7171

7272

73-
@pytest.fixture(scope="session")
73+
@pytest.fixture(scope="function")
7474
def tracer_provider(memory_exporter):
7575
original_tracer_provider = trace_api.get_tracer_provider()
7676

@@ -86,7 +86,7 @@ def tracer_provider(memory_exporter):
8686
trace_api.set_tracer_provider(original_tracer_provider)
8787

8888

89-
@pytest.fixture(scope="session")
89+
@pytest.fixture(scope="function")
9090
def memory_exporter():
9191
memory_exporter = InMemorySpanExporter()
9292
return memory_exporter

0 commit comments

Comments
 (0)