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

Celery docker-tests check started failing #1837

Closed
jeremydvoss opened this issue Jun 7, 2023 · 7 comments
Closed

Celery docker-tests check started failing #1837

jeremydvoss opened this issue Jun 7, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@jeremydvoss
Copy link
Contributor

jeremydvoss commented Jun 7, 2023

Contrib sibling of this

Describe your environment Checks that previously passed have started failing and block my pr:

=================================== FAILURES ===================================
__________________________ test_fn_exception_expected __________________________

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

    def test_fn_exception_expected(celery_app, memory_exporter):
        @celery_app.task(throws=(MyException,))
        def fn_exception():
            raise MyException("Task class is failing")
    
        result = fn_exception.apply()
    
        assert result.failed() is True
        assert "Task class is failing" in result.traceback
    
        spans = memory_exporter.get_finished_spans()
        assert len(spans) == 1
    
        span = spans[0]
    
>       assert span.status.is_ok is True
E       assert False is True
E        +  where False = <opentelemetry.trace.status.Status object at 0x7fbb1d7d6d40>.is_ok
E        +    where <opentelemetry.trace.status.Status object at 0x7fbb1d7d6d40> = <opentelemetry.sdk.trace.ReadableSpan object at 0x7fbb1d7d7b20>.status

celery/test_celery_functional.py:306: AssertionError
______________________ test_class_task_exception_excepted ______________________

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

    def test_class_task_exception_excepted(celery_app, memory_exporter):
        class BaseTask(celery_app.Task):
            throws = (MyException,)
    
            def run(self):
                raise MyException("Task class is failing")
    
        task = BaseTask()
        # register the Task class if it's available (required in Celery 4.0+)
        register_task = getattr(celery_app, "register_task", None)
        if register_task is not None:
            register_task(task)
    
        result = task.apply()
    
        assert result.failed() is True
        assert "Task class is failing" in result.traceback
    
        spans = memory_exporter.get_finished_spans()
        assert len(spans) == 1
    
        span = spans[0]
    
>       assert span.status.is_ok is True
E       assert False is True
E        +  where False = <opentelemetry.trace.status.Status object at 0x7fbb1d6fb910>.is_ok
E        +    where <opentelemetry.trace.status.Status object at 0x7fbb1d6fb910> = <opentelemetry.sdk.trace.ReadableSpan object at 0x7fbb1d6fbc40>.status

celery/test_celery_functional.py:446: AssertionError

Steps to reproduce
Make a pr

What is the expected behavior?
Checks pass

What is the actual behavior?
Checks fail

Additional context
Possibly related to #653

@jeremydvoss
Copy link
Contributor Author

Likely because a new version of celery was just released
https://pypi.org/project/celery/#history

@shalevr
Copy link
Member

shalevr commented Jun 11, 2023

Do you work on this issue?

@shalevr
Copy link
Member

shalevr commented Jun 12, 2023

It is indeed started because of the new celery version(5.3)
but I think the test was wrong in the first place.
the test failed for


and

but in this test we test exception handling, so if I understand this correctly, it should test is_ok=false and StatusCode.Error

@shalevr
Copy link
Member

shalevr commented Jun 12, 2023

It probably changed after this PR
celery/celery#8149

@shalevr
Copy link
Member

shalevr commented Jun 12, 2023

@ocelotl ocelotl self-assigned this Jun 13, 2023
@ocelotl
Copy link
Contributor

ocelotl commented Jun 13, 2023

This is pretty much blocking CI, assigning to myself and investigating.

ocelotl added a commit to ocelotl/opentelemetry-python-contrib that referenced this issue Jun 13, 2023
@shalevr
Copy link
Member

shalevr commented Jun 13, 2023

There is PR on this issue #1841
I think that the test was wrong in the first place
@ocelotl please look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants