Skip to content

Conversation

@szokeasaurusrex
Copy link
Member

Fixes #4241


Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval.

@codecov
Copy link

codecov bot commented May 20, 2025

⚠️ Parser warning

The parser emitted a warning. Please review your JUnit XML file:

Warning while parsing testcase attributes: Limit of string is 1000 chars, for name, we got 2301 at 1:2560 in /home/runner/work/sentry-python/sentry-python/.junitxml

❌ 64 Tests Failed:

Tests completed Failed Passed Skipped
23935 64 23871 5876
View the top 3 failed test(s) by shortest run time
tests.integrations.clickhouse_driver.test_clickhouse_driver::test_clickhouse_client_breadcrumbs_with_pii
Stack Traces | 0s run time
tests/conftest.py:93: in _
    reraise(*e)
sentry_sdk/utils.py:1746: in reraise
    raise value
sentry_sdk/integrations/clickhouse_driver.py:120: in _inner_end
    span.scope.add_breadcrumb(
E   AttributeError: 'NoneType' object has no attribute 'add_breadcrumb'
tests.integrations.clickhouse_driver.test_clickhouse_driver::test_clickhouse_dbapi_breadcrumbs
Stack Traces | 0s run time
tests/conftest.py:93: in _
    reraise(*e)
sentry_sdk/utils.py:1746: in reraise
    raise value
sentry_sdk/integrations/clickhouse_driver.py:120: in _inner_end
    span.scope.add_breadcrumb(
E   AttributeError: 'NoneType' object has no attribute 'add_breadcrumb'
tests.integrations.langchain.test_langchain::test_langchain_agent[False-True-False]
Stack Traces | 0s run time
tests/conftest.py:93: in _
    reraise(*e)
sentry_sdk/utils.py:1746: in reraise
    raise value
sentry_sdk/integrations/langchain.py:332: in on_chain_end
    self._exit_span(span_data, run_id)
sentry_sdk/integrations/langchain.py:164: in _exit_span
    span_data.span.__exit__(None, None, None)
sentry_sdk/tracing.py:408: in __exit__
    self.scope_manager.__exit__(ty, value, tb)
.../hostedtoolcache/Python/3.12.10.../x64/lib/python3.12/contextlib.py:144: in __exit__
    next(self.gen)
sentry_sdk/scope.py:1681: in new_scope
    _current_scope.reset(token)
E   ValueError: <Token var=<ContextVar name='current_scope' default=None at 0x7fa99bd437e0> at 0x7fa98a32dec0> was created in a different Context

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@szokeasaurusrex
Copy link
Member Author

#4241 is already fixed in potel_base, which will become version 3.0 of the Python SDK. We have decided not to fix the issue in 2.x, since the fix would be quite complex, and since the issue has only been reported internally

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using @sentry_sdk.trace with concurrent futures messes up span hierarchy

2 participants