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 Celery tests in Potel #3772

Open
wants to merge 14 commits into
base: potel-base
Choose a base branch
from

Conversation

antonpirker
Copy link
Member

No description provided.

Copy link

codecov bot commented Nov 13, 2024

❌ 8883 Tests Failed:

Tests completed Failed Passed Skipped
18225 8883 9342 4111
View the top 3 failed tests by shortest run time
tests.test_scope test_with_use_isolation_scope_data
Stack Traces | 0.001s run time
tests/test_scope.py:496: in test_with_use_isolation_scope_data
    assert current_scope_in._tags == {"before_current_scope": 1}
E   AssertionError: assert {'tag1': 'value', 'before_current_scope': 1} == {'before_current_scope': 1}
E     
E     Common items:
E     {'before_current_scope': 1}
E     Left contains 1 more item:
E     {'tag1': 'value'}
E     
E     Full diff:
E       {
E           'before_current_scope': 1,
E     +     'tag1': 'value',
E       }
tests.test_scope test_with_use_isolation_scope_data
Stack Traces | 0.001s run time
tests/test_scope.py:496: in test_with_use_isolation_scope_data
    assert current_scope_in._tags == {"before_current_scope": 1}
E   AssertionError: assert {'tag1': 'value', 'before_current_scope': 1} == {'before_current_scope': 1}
E     
E     Common items:
E     {'before_current_scope': 1}
E     Left contains 1 more item:
E     {'tag1': 'value'}
E     
E     Full diff:
E       {
E           'before_current_scope': 1,
E     +     'tag1': 'value',
E       }
tests.test_scope test_with_use_scope_data
Stack Traces | 0.001s run time
tests/test_scope.py:690: in test_with_use_scope_data
    assert isolation_scope_in._tags == {"before_isolation_scope": 1}
E   AssertionError: assert {'tag1': 'value', 'before_isolation_scope': 1} == {'before_isolation_scope': 1}
E     
E     Common items:
E     {'before_isolation_scope': 1}
E     Left contains 1 more item:
E     {'tag1': 'value'}
E     
E     Full diff:
E       {
E           'before_isolation_scope': 1,
E     +     'tag1': 'value',
E       }

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

Comment on lines 223 to 228
assert execution_event["spans"][0] == ApproxDict({
"trace_id": str(span.trace_id),
"same_process_as_parent": True,
"op": "queue.process",
"description": "dummy_task",
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just makes the diff of failing tests way easier to read

@@ -1582,6 +1582,9 @@ def is_success(self):

def finish(self, end_timestamp=None):
# type: (Optional[Union[float, datetime]]) -> Optional[str]
if hasattr(self._otel_span, "status") and self._otel_span.status.status_code == StatusCode.UNSET:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do this in __exit__ above since we are already setting INTERNAL_ERROR there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if people do not use the contextmanager, the status will not be set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When thinking of it, thats probably ok. If you use the context manager, we take care of the status. If you start/finish spans manually, you need to take care of the status

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already doing this in another branch so you can just remove this and pull later

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

Successfully merging this pull request may close these issues.

2 participants