Skip to content

Flaky celery test with pypy-3.8 ubuntu #3521

Open
@xrmx

Description

@xrmx
Contributor
=================================== FAILURES ===================================
________________________ TestMetrics.test_basic_metric _________________________

self = <tests.test_metrics.TestMetrics testMethod=test_basic_metric>

    def test_basic_metric(self):
        CeleryInstrumentor().instrument()
        start_time = default_timer()
        task_runtime_estimated = (default_timer() - start_time) * 1000
    
        metrics = self.get_metrics()
        CeleryInstrumentor().uninstrument()
>       self.assertEqual(len(metrics), 1)
E       AssertionError: 0 != 1

instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py:46: AssertionError

CI run: https://github.com/open-telemetry/opentelemetry-python-contrib/actions/runs/15156691327/job/42613075177

Activity

jomcgi

jomcgi commented on May 25, 2025

@jomcgi
Contributor

This should be resolved when we drop support for Python 3.8
I've rebased #3399 so should be able to get final reviews / merge soon.

rbagd

rbagd commented on May 26, 2025

@rbagd
Contributor

Not sure if this specifically Python 3.8 related, albeit definitely more common. I've hit similar issues in other versions as well.

I've reworked Celery metrics instrumentation recently in this PR, and with that the tests seem more robust to flakiness, albeit one does have to wait for tasks to finish properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xrmx@rbagd@jomcgi

        Issue actions

          Flaky celery test with pypy-3.8 ubuntu · Issue #3521 · open-telemetry/opentelemetry-python-contrib