8000
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
d31a36c
to
c5e4a6d
Compare
❌ 1075 Tests Failed:
View the top 1 failed tests by shortest run time
View the full list of 2 ❄️ flaky tests
To view more test analytics, go to the Test Analytics Dashboard |
@@ -786,14 +786,6 @@ def span(self, span): | |||
# type: (Optional[Span]) -> None | |||
"""Set current tracing span.""" | |||
self._span = span | |||
# XXX: this differs from the implementation in JS, there Scope.setSpan |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
removing this opaque behavior, we will not rely on it anymore
if parent_context.trace_flags.sampled: | ||
return True | ||
if parent_context.trace_flags.sampled is not None: | ||
return parent_context.trace_flags.sampled |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixes bug in the unsampled case
@@ -1398,7 +1399,9 @@ def span_id(self): | |||
@property | |||
def is_valid(self): | |||
# type: () -> bool | |||
return self._otel_span.get_span_context().is_valid | |||
return self._otel_span.get_span_context().is_valid and isinstance( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fixes another twp bug
@pytest.mark.parametrize("sample_rate", [0.0, 1.0]) | ||
def test_continue_from_headers(sentry_init, capture_envelopes, sampled, sample_rate): | ||
def test_continue_trace( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
simplified this test since it was too confusing and we can write a separate test for explicit sampling later if really wanted
"transaction": "Head SDK tx", | ||
"trace_id": trace_id, | ||
} | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"args,expected_refcount", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
no longer relevant
from sentry_sdk.tracing_utils import should_propagate_trace | ||
from sentry_sdk.utils import Dsn | ||
|
||
|
||
def test_span_trimming(sentry_init, capture_events): | ||
sentry_init(traces_sample_rate=1.0, _experiments={"max_spans": 3}) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
no longer supported, if we want to support max_spans
we will need some logic in the span processor but it is not simple to support it
@@ -82,197 +58,31 @@ def test_transaction_data(sentry_init, capture_events): | |||
assert span_data.items() >= {"spanfoo": "spanbar"}.items() | |||
|
|||
|
|||
def test_start_transaction(sentry_init): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
most of the following tests are too unit-testy and don't add much or are obsolete.
import pytest | ||
|
||
|
||
def test_standalone_span_iter_headers(sentry_init): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
there is no longer a difference between a standalone span and a transaction so this is obsolete
pass | ||
|
||
assert len(events) == 1 | ||
|
||
|
||
@pytest.mark.parametrize("sampling_decision", [True, False]) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
no longer true, since unsampled spans can't have attributes and plus I don't see what the point of this test is
import sentry_sdk | ||
|
||
|
||
def test_start_span_description(sentry_init, capture_events): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
we will remove span description completely since it was already deprecated
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
see couple suggestions, else lgtm
c5e4a6d
to
5e6dbbb
Compare
leaving comments in code for explanation