Conversation
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 |
| # 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.
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.
fixes bug in the unsampled case
| 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.
fixes another twp bug
| @pytest.mark.parametrize("sampled", [True, False, None]) | ||
| @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.
simplified this test since it was too confusing and we can write a separate test for explicit sampling later if really wanted
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "args,expected_refcount", |
|
|
||
|
|
||
| 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.
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
| assert span_data.items() >= {"spanfoo": "spanbar"}.items() | ||
|
|
||
|
|
||
| def test_start_transaction(sentry_init): |
There was a problem hiding this comment.
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.
there is no longer a difference between a standalone span and a transaction so this is obsolete
| assert len(events) == 1 | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("sampling_decision", [True, False]) |
There was a problem hiding this comment.
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.
we will remove span description completely since it was already deprecated
sentrivana
left a comment
There was a problem hiding this comment.
see couple suggestions, else lgtm
c5e4a6d to
5e6dbbb
Compare
leaving comments in code for explanation