Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky docker celery tests #638

Closed
owais opened this issue Aug 25, 2021 · 2 comments · Fixed by #629 or #652
Closed

Fix flaky docker celery tests #638

owais opened this issue Aug 25, 2021 · 2 comments · Fixed by #629 or #652

Comments

@owais
Copy link
Contributor

owais commented Aug 25, 2021

Celery docker tests randomly fail with the following output:

=================================== FAILURES ===================================
_________________________ test_custom_tracer_provider __________________________

celery_app = <Celery celery.tests at 0x7f88b2d3cbe0>
memory_exporter = <opentelemetry.sdk.trace.export.in_memory_span_exporter.InMemorySpanExporter object at 0x7f88b8305790>

    def test_custom_tracer_provider(celery_app, memory_exporter):
        @celery_app.task
        def fn_task():
            return 42
    
        resource = resources.Resource.create({})
        tracer_provider = TracerProvider(resource=resource)
        span_processor = export.SimpleSpanProcessor(memory_exporter)
        tracer_provider.add_span_processor(span_processor)
    
        trace_api.set_tracer_provider(tracer_provider)
    
        CeleryInstrumentor().uninstrument()
        CeleryInstrumentor().instrument(tracer_provider=tracer_provider)
    
        fn_task.delay()
    
        spans_list = memory_exporter.get_finished_spans()
>       assert len(spans_list) == 1
E       assert 2 == 1
E         +2
E         -1

celery/test_celery_functional.py:579: AssertionError

We need to investigate this and fix th test so it always passes.

@owais owais reopened this Aug 26, 2021
@owais
Copy link
Contributor Author

owais commented Aug 26, 2021

We didn't fix the problem completely. The fix did reduce the chance of this failing by a huge factor it seems but I did see it fail at least once (compared to ~50% of builds) since this was merged.

@lzchen
Copy link
Contributor

lzchen commented Aug 26, 2021

@ocelotl ocelotl transferred this issue from open-telemetry/opentelemetry-python Aug 30, 2021
ocelotl added a commit to ocelotl/opentelemetry-python-contrib that referenced this issue Aug 30, 2021
ocelotl added a commit to ocelotl/opentelemetry-python-contrib that referenced this issue Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants