Skip to content

Commit 3f2b752

Browse files
committed
Fix flaky test
1 parent 554c391 commit 3f2b752

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

sentry_sdk/opentelemetry/span_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def _span_to_json(self, span: ReadableSpan) -> Optional[dict[str, Any]]:
247247
if not span.context:
248248
return None
249249

250-
# need ot ignore the type here due to TypedDict nonsense
250+
# need to ignore the type here due to TypedDict nonsense
251251
span_json: Optional[dict[str, Any]] = self._common_span_transaction_attributes_as_json(span) # type: ignore
252252
if span_json is None:
253253
return None

sentry_sdk/opentelemetry/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ def is_sentry_span(span: ReadableSpan) -> bool:
6666
if not span.attributes:
6767
return False
6868

69-
span_url = span.attributes.get(SpanAttributes.HTTP_URL, None)
70-
71-
if span_url is None or not isinstance(span_url, str):
69+
span_url = get_typed_attribute(span.attributes, SpanAttributes.HTTP_URL, str)
70+
if span_url is None:
7271
return False
7372

7473
dsn_url = None

tests/integrations/logging/test_logging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ def test_logging_captured_warnings(sentry_init, capture_events, recwarn):
259259
assert events[1]["logentry"]["params"] == []
260260

261261
# Using recwarn suppresses the "third" warning in the test output
262-
assert len(recwarn) == 1
263-
assert str(recwarn[0].message) == "third"
262+
third_warnings = [w for w in recwarn if str(w.message) == "third"]
263+
assert len(third_warnings) == 1
264264

265265

266266
def test_ignore_logger(sentry_init, capture_events):

0 commit comments

Comments
 (0)